Hello

I've a "User" model. A user, belongs to a state model.

I've the following in the user form:

[code]
    <%= f.select(:state_id, State.find(:all).map {|c| [c.name,
c.id]},{:prompt => "Select a canton"}, {:onchange =>
"#{remote_function(:url  => {:action => "update_municipals"},
                                                       :with =>
"'name='+value")}"}) %>
[/code]

However when I add a user, it's "state_id" is null, but if rename
state_id to "state", the id number of the state is saved correctly.

Thanks
-- 
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@googlegroups.com
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