Elsewhere

“The Ruby Conspiracy” : July’s Troll Of The Month

It's time to bring in a regular feature.. Troll Of The Month. Every month or so there appears to be a new article circulating that explains why 'Ruby sucks' or why you shouldn't use Rails to develop serious applications. Most of the time, they're unbalanced and poor explained, even if the author has some valid points.

Read more →

Refactoring a Rails app to be RESTful

Scott Raymond has written a useful article showing the thinking behind his refactoring of IconBuffet.com from an action-heavy URL scheme to a REST based URL scheme.
The application behind IconBuffet.com, a royalty-free stock icon store, went from 10 controllers and 76 actions to 13 controllers that more closely followed the models involved, and 58 total actions. Most of the new actions are uniform and match to the new Rails methodology of mapping HTTP verbs (GET, PUT, POST, DELETE, etc.) to Rails controller actions. You can learn more about this structure from David Heinemeier Hansson's slides (PDF) from RailsConf, or watch the video of his keynote presentation.

Read more →

Pre-processing / normalizing parameters in Rails

Bruce Williams tries to solve the problem of multiple parameter types in Rails. For example, an action may accept dates via a parameter, but dates may be supplied in many forms. A 'date' parameter might arrived as if from a date_select helper, or might even be typed in directly by a user, or be pulled from a database. Rather than use before_filters to check parameters and normalize them, Bruce suggests that it should be possible to add basic conversion tools to certain data types so that all data is normalized by the time it hits your controllers.

Read more →