I am rendering a partial like this:
$("#box_container").html("<%= escape_javascript( render :partial => 'contacts/contact_tile', :collection => @contacts) %>")
Problem is that my partial is expecting the variable ‘contact’.
ActionView::Template::Error (undefined local variable or method `contact'
I simply want to tell the partial to expect a variable contact. Should iterate through @contacts as contact. How do I do that?
Found this is also helpful from the docs. You aren’t limited to having the variable named after the partial:
http://guides.rubyonrails.org/layouts_and_rendering.html
With this change, you can access an instance of the @products collection as the item local variable within the partial.”