I would like to generate a select list from multiple associations. Do
not know what the problem is. Hope anyone can
help.
the code below gives me a: “You have a nil object when you didn’t
expect it!
The error occurred while evaluating nil.filename”
----------in the controller----------
@skinType = Furni.find(:all, :include =>[:imageasset => {:skin =>
[:skintype, :skinstyle]}]).map {|st| [st.imageasset. filename, st.id] }
------ in the view ------
<% form_tag( ‘list’) do %>
<%= select_tag :skin, options_for_select([“View-All”]+@skinType,
@skintype_id.to_i), :onChange =>
“location.href='http://www.furnii.com/skins/list?skintype_id='+options[selectedIndex].value”
%>
<% end %>