This project is archived and is in readonly mode.

#853 ✓resolved
Josh Susser

Fix render :partial to not attempt to render collections that are nil

Reported by Josh Susser | August 18th, 2008 @ 07:27 PM

Attempting the following

render :partial => "foo", :collection => @foos

when @foos is nil and the _foo.html.erb partial does something like foo.name will result in a method_missing because it's trying to call #name on nil. Fixed render :partial to skip rendering the collection when it's nil, just like when it's an empty array.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages