Friday, November 7, 2008

Rails Guides

The Ruby on Rails team and many Rails enthuisiasts have been working hard on a new site for guides for Rails. They range from guides for getting started, to guides covering more of the specifics. The getting started guide covers a lot, but it can look a little length to the newcomer - perhaps it should be broken into sections. It does, though, cover each of the pieces and paradigms used in Rails, making learning the language fully rather easy. For example, it covers the Model View Controller paradigm used in Rails. Models are representations of the data we used, Views are displays of that data, and the Controller interacts with the user. Then it goes on to talk about all the pieces of rails, ranging from Active Record (for Models) through Active Support (for all the little things).

Wednesday, November 5, 2008

Rails Dynamic Links

Since I've been working on a program for Mindbridge for a while, (and you can see how busy I am), I try occasionally to post useful things I remember here. One is about Rails dynamic linking abilities. I recently forgot, then remembered again, about how easy it is to link to an object.

(%= link_to "View", @object %) instead of (%= link_to "View", object_path(@object) %)

You can use a handy REST cheat sheet to keep it all handy. It helps me remember that I have to explicitly declare the delete method, for example, in my links.