From the little-but-useful department comes a new addition to Rails that lets you explicitly name the local variable exposed to a partial template when using a collection partial. So, for instance, in this statement:
render :partial => 'employees', :collection => @workers, :as => :person |
each element of the workers collection will be exposed as person within the employees template. No longer are you hostage to your template name.
tags: ruby, rubyonrails

Isn’t the default to provide a local variable with the same name as the partial? So that “render :partial => “employee”, :collection => @people” would result in a local variable called “employee”?
Quite right, Fabio, I’ve updated my post accordingly. Thanks!
Great news from the little-but-useful department! This is something which has mildly annoyed me since day dot with Rails. Thanks for keeping your ear to the trunk.
thats some really clever stuff to add I will hav eot give it a try sometime.