On Oct 2, 4:10 am, Sam Ginko <[EMAIL PROTECTED]> wrote:
> 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] }

It's telling you that there is a Furni whose imageasset is nil.

Fred
>
> ------ in the view ------
>
> <% form_tag( 'list') do %>
> <%= select_tag :skin, options_for_select(["View-All"[EMAIL PROTECTED],
> @skintype_id.to_i), :onChange =>
> "location.href='http://www.furnii.com/skins/list?skintype_id='+options[selectedIndex].value"
> %>
> <% end %>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to