![]()
A couple of weeks ago I picked up a “Rough Cuts” version of the Rails Cookbook by Rob Orsini. This is the same book that was recently highlighted on the Ruby on Rails blog.
Almost immediately it started to pay for itself. I had a couple issues where I was trying to get my join model to be a sortable list but only keep track of a records position in the list constrained to one of the foreign keys. Well on page 117 there is a recipe for using acts_as_list that automatically manages the position of record in the model and takes a :scope => :model option to constrain the position field to keep track of a record’s position relative to the foreign key “model_id”. Each new “model_id” would behave as a separate list within the same model.
The recipe’s are logically organized and there are A LOT of them: 15 Chapters (560+ pages) dealing with every aspect of Rails you can imagine. While I prefer the writing style of Chad Fowler’s Rails Recipes a bit more, the sheer wealth of information in this resource can not be understated. And the content spans subjects at various difficulty levels from “I built my whole app using scaffold!” to “I’m getting a free ticket to Railsconf.”
Two areas that were extremely helpful were in the areas on Active Record and RESTful resources. Since Active Record is the largest and arguably the most powerful part of rails , it’s really helpful to be able to leverage it’s features whenever possible. As they say, “Convention over configuration!” Also RESTful resources are brand new and as such there is not a lot of information out there to help you know how to best use them, so it is good to find resources that do.
Sphere: Related Content
0 Responses to “Rails Cookbook”
Leave a Reply