Select a id

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| [, ] }, { :prompt => “selecteer een rubriek”})

Now i find out that when i set the form options in a partial it works
But when i set the options directly into the same view the heading_id is
My question is why is a partial needed to get an select working