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.
25c4b7d5fc7f09900d8f272bcb31d114?d=identicon&s=25 Hamid Raza (hamidraza)
on 2009-02-15 13: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
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2009-02-15 17: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 Raza
25c4b7d5fc7f09900d8f272bcb31d114?d=identicon&s=25 Hamid Raza (hamidraza)
on 2009-02-15 22: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 Raza



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