Hi everyone,
I''m stuck on something that seems to be super easy, but maybe
I''m just
too tired to see the obvious answer.
I''m trying to make a drop down with select_tag and
options_from_collection_for_select. I''m trying to fill this drop down
list with different human races (white, black, hispanic, etc. in the
database under the name field, with a unique id for each) in the index
page of lost_children.
I have two models:
lost_children.rb
[code]
belongs_to :race
[/code]
race.rb
[code]
has_many: lost_childrens
[/code]
in the index view of lost_childrens:
[code]
<%= select_tag options_from_collection_for_select(Race.find(:all), :id,
:name) %>
[/code]
This just brings up an empty drop down box. I''m thinking it may be a
relationship problem between the models but at this point I can''t even
think clearly. Any help is greatly appreciated!
Best regards,
Tony
--
Posted via http://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---