Hi, I am having the following issue with a partial. During initial page
load, I am doing a “render_partial_collect ‘foo’, @foos”, and all goes
well. Each foo partial makes use of a variable inside called ‘foo’ (and
can get foo.id etc).
After all the partials are loaded, I need to :update a div corresponding
to one of the partials (ie re-load the partial in that div). I do this
via a link_to_remote call, calling the do_stuff method in a controller.
The do_stuff method attempts to render the foo partial back, passing it
a variable like so:
render_partial ‘something/foo’, nil, ‘foo’ => Foo.find(params[:foo])
This code complains that foo is null when it renders back, however, if I
copy the _foo.rhtml code into a file called _bar.rhtml and do:
render_partial ‘something/bar’, nil, ‘foo’ => Foo.find(params[:foo])
everything works. Why is this happening?