rails/rails — pull request #5839 by cbarton (2012-04-13 23:48:22+00:00)
Title: Rendering a partial with objects or collections using :as and a layout breaks

Currently,

`<%= render :partial => "user", :layout => "layouts/user", :object => user, :as => :user %>`

In _user.erb.html

`<%= user.first_name %>`

In layouts/_user.erb.html

`

<%= yield %>

`

would throw an exception in the layout not having access to the `user` local variable.

This pull fixes that.