

Cool Things in Rails 2.3 - 100k
http://railspikes.com/2009/3/30/10-cool-things-in-rails-23

======
mdasen
Rails has really kept up its development pace nicely. Nested assignments and
forms are a wonderful addition. Dealing with related data (in forms and
saving) had always been quite a pain and they've done a great job of making
that a lot easier.

Some things not mentioned in the slideshow that were important (at least in my
opinion):

* Dynamic scopes: you can say Article.scope_by_XXX and it will allow you to use scopes without explicitly naming all of them.

* Batch processing: this allows you to get the results of a query in smaller batches so that you don't have to load everything into memory at once.

* Rack support: it's nice to have Rails being able to be deployed in the way that the community is going for Ruby apps.

* Try: probably one of the best additions. It allows you to say @person.spouse.try(:first_name). Normally, if the person didn't have a spouse and you did @person.spouse.first_name you'd get an exception saying that nil (which is what @person.spouse would evaluate to) doesn't have a method first_name - which is true. This way you don't have to keep saying, "only call @person.spouse.first_name if the @person has a spouse".

* Application Templates: These are basically shortcut files you can make for setting up a new project. We all have slight variants and we can set up the default things we want in all our applications so we aren't starting from such a blank slate (and that way you don't forget to do things like create a .gitignore file before you put your database password out there for the world to see).

~~~
gamache
Oh, good to hear about try() -- that totally beats Object#andand.

~~~
jpcx01
Hmm.. not really. But its ok. andand is much cooler since you can call
functions directly, and with arguments. Try is good for sending simple
messages like :size and :errors and not have to care if the object is nil

------
thomaslee
#9 is especially important. The parameter parsing code in Rails < 2.3 was
painful to work with for all but the most rudimentary forms. Great to finally
see it in there!

