I know I must be doing something dumb, but I can't seem to send a
local variable to my partial. The below code leads to the following
error:

NameError in Residential_listings#new
undefined local variable or method `foo' for #<ActionView::Base:
0x3fb53f8>

I am trying to call the variable 'foo' in a partial called
_attachment.html.erb, which is nested in another partial called
_form.html.erb. In _form.html.erb, I have:
<%= render(     :partial => 'listings/attachment',
                        :collection => @residential_listing.attachments,
                        :locals => {:foo => "bar"}) %>

And then in /listings/_attachment.html.erb, I simply have:
<%= foo>

This causes the error above. Can anyone help me figure out what I'm
doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to