I render a partial like so:
<%= render :partial => 'widgets/some_partial, :locals => {:foo => 'bar'} %>
So inside of _some_partial.html.erb
I render two more partials like so:
<% #foo.nil? #=> false %>
<%= render :partial => 'widgets/another_partial', :locals => {:foo => foo} %>
`<%= render :partial => 'widgets/another_partial_again', :locals => {:foo => foo} %>`
The foo local variable renders fine in some_partial.html.erb
and even in another_partial_again.html.erb
. However, the foo variable is inaccessible in another_partial.html.erb
even though I explicitly passed it in the render call.
What is happening here?
Thanks for the help.
undefined local variable or method
or is itnil
? Can you show the code that usesfoo
on these sub-partials? – Fontes