Forum: Ruby on Rails select a id

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fa342466c787830ea65ffc638d22d9c4?d=identicon&s=25 GG9 Rails (gorter9)
on 2007-02-03 11:39
I have a database called adverts with an field heading_id
Then i create a select with the options from the table heading, name.
But when i save that form_tag the field heading_id is currently NULL all
other fields are saved but heading_id doesn't changed



<%= select("advert", "heading_id", Heading.find(:all).collect {|p| [
p.name, p.id ] }, { :prompt => "selecteer een rubriek"})
%>
Fa342466c787830ea65ffc638d22d9c4?d=identicon&s=25 GG9 Rails (gorter9)
on 2007-02-04 10:12
Now i find out that when i set the form options in a partial it works
fine.
But when i set the options directly into the same view the heading_id is
empty.
My question is why is a partial needed to get an select working
This topic is locked and can not be replied to.