Correct use of the flash in Rails
[Update 9 May 2012] This seems to work for testing flash.now in Rails 3: PLAIN TEXT RUBY: it "puts an error in the flash" do post :create flash[:error].should == "Sorry, that's wrong." end it...
View ArticleRails, SOAP and REST
From the list of new features coming in Rails 2.0: It’ll probably come as no surprise that Rails has picked a side in the SOAP vs REST debate. Unless you absolutely have to use SOAP for integration...
View ArticleWeird Rails bug
I Spent some time yesterday tracking down a bizarre bug which was causing some of our Selenium tests to fail. Watching the browser running the tests, I could see that occasionally a page would fail to...
View ArticleRails Envy’s take on the werewolf question
This clip [MP3, 57s] from a Rails Envy podcast made me laugh. It's referring to Charles Nutter's recent musings on whether werewolf is killing the conference hackfest. Incidentally, how often do you...
View Article“You have to declare the controller name in controller specs”
For ages I've been getting an intermittent problem with RSpec, where occasionally I'd see the following error on a model spec: You have to declare the controller name in controller specs. For example:...
View ArticleDefending Ruby and Rails in the Enterprise
I consider myself fortunate that the previous two projects I worked on (the BT Web21C Portal and Mojo) were Rails-based (actually it wan't just luck in the former case, as I had a part in selecting the...
View ArticleRails 2.2 Envycast Review
I've been a fan of the RailsEnvy guys (Gregg Pollack and Jason Seifer) ever since their "Hi, I'm Ruby on Rails" spoof of the "I'm a Mac" ads, and have been listening to their podcast ever since. I even...
View ArticleMy (very!) small part in the Array#forty_two controversy
For those outside the Rails community who have no idea what I'm on about, some people got a bit upset about Rails 2.2 defining Array#second up to Array#tenth, so for example you can call foo.fifth...
View ArticleManaging gems in a Rails project
Over the years I've tried a number of approaches for managing gem dependencies in a Rails project. Here's a quick round-up of what I've tried, and the pros and cons of each. Just use what's on the...
View ArticleMemoised remote attribute readers for ActiveRecord
I was recently working with an ActiveRecord class that exposed some attributes retrieved from a remote API, rather than from the database. The rules for handling the remote attributes were as follows:...
View Article