10 October 2013
By default, session data in Rails is stored via a cookie in the user’s browser. It’s a nice, simple storage mechanism, but it means that the server has absolutely no “memory” of a given session. This can cause security problems for your application.
7 October 2012
Almost a year ago, on a complete whim, I decided to try to hook up the headless browser PhantomJS with Ruby’s full-stack acceptance testing framework, Capybara.
20 September 2012
Controllers in Rails are a problem. Actions sometimes become unmanageably long, and it’s often difficult to know how to test them when you need it most. At Railsberry in May, I presented a new way of writing controllers.
20 April 2012
Rails controllers violate the Single Responsibility Principle. Each “action” has a different responsibility and should be contained in a separate object. Controllers are also hard to unit test, so we end up using slow “functional tests”.
15 April 2012
Recently I pushed version 0.6.0 of Poltergeist. This version brings some pretty awesome features that I am very excited about.
19 February 2012
One of my favourite features of Ruby 1.9 is the
#source_location method of
Method. Let me explain. Often I am confronted with a large code base (usually Rails), and want to figure out exactly where some method on some object is defined. Rails has many dark corners, and sometimes finding things isn’t entirely straightforward.
19 February 2012
Today I had a situation where I wanted to use perftools.rb to profile a test suite, which was written with Ruby’s
9 January 2012
Earlier today I made an off-the-cuff remark about encapsulation on twitter.
3 January 2012
This announcement is coming way later than I had originally intended. Last October I started experimenting with the idea of writing a driver for Capybara that would use PhantomJS as the browser.
initialize_copyin Ruby »
30 August 2011
Ruby has two methods for creating shallow copies of objects:
14 August 2011
Mass assignment security is a feature in Active Model (and therefore Active Record) which allows you to be selective about what input you will accept when ‘mass assigning’ a hash of attributes.
10 July 2011
The main area of Ruby on Rails that I work on is Active Record. As such, I see a lot of bug reports for Active Record. This article will be about how to submit a good bug report to help people like me (Rails committers) help people like you (bug inflicted developers).