Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Refactoring your Rails application to be RESTful

Refactoring your Rails application to be RESTful

Scott Raymond has written a useful article showing the thinking behind his refactoring of from an action-heavy URL scheme to a REST based URL scheme.

The application behind, 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.

Rate this Article