-
The Lifecycle of a Web Request
As a part of a recent job application process, I was asked a few general questions pertaining to software development. I thought I would share the questions and my answers here on my blog.
The Question
A user browses to some URL in their browser. Please describe in as much detail as you think is appropriate the lifecycle of this request and what happens in the browser, over the network, on servers, and in the Rails application before the request completes.
Continue reading … -
Time in Ruby and ActiveRecord
How does the Ruby
Continue reading …Time
class relate to the ActiveRecordtime
column type? -
Typecasting in Ruby and Rails
I recently had the need to typecast string values passed as query parameters to a controller action to their appropriate type. In solving this problem, I've learned a lot about Rails' typecasting layer, Ruby's typecasting methods, as well as a handful of edge cases. The result was a typecasting function that I think has a lot to offer.
Continue reading … -
An Example of an ERB Component
An example of building an "ERB component", that is, an ERB partial that has ansome flexibility around their HTML output articulated via an interface in the
Continue reading …render
call. -
A function for generating HTML attribute values
How might I write a function that was as flexible as possible in its type signature, and yet still predictable and sane in its output of HTML attribute values?
Continue reading …