Forum: Ruby on Rails how to get the value of Collection_select in controller

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.
Hamid R. (Guest)
on 2009-02-15 14:40
this is my view code
 <%= f.collection_select(:user, :province_id , @provinces ,:id , :name)
%>
and this is my
controller code

 params[:user_province_id]

it is giving nothing :(
when i use observe field and use  "params[:user_province_id]" in
controller then it gives the value easily.

but when i submit the form, this collection_select gives me nothing.

i dont know what is the problem .
plz n e one help me out


thanx in advance
Maurício L. (Guest)
on 2009-02-15 18:19
(Received via mailing list)
Use:

 params[:user][:province_id]

-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)



On Sun, Feb 15, 2009 at 9:40 AM, Hamid R.
Hamid R. (Guest)
on 2009-02-15 23:01
Maurício Linhares wrote:
> Use:
>
>  params[:user][:province_id]
>
> -
> Maur�cio Linhares
> http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
> (en)
>
>
>
> On Sun, Feb 15, 2009 at 9:40 AM, Hamid R.



Thanks a lot Maurício Linhares. It worked for me :)
This topic is locked and can not be replied to.