Forum: Ruby on Rails Html tag

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.
Dfcdb1e3ca91952338d090134b9e0316?d=identicon&s=25 Valen (Guest)
on 2006-06-05 18:49
I have Html tag <select>:

<select name='tag'>
<OPTION value ='smth1' >  smth1
<OPTION value ='smth2' >  smth2
</select>

and my question is: how to obtain selected value by using ruby or rails?
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2006-06-05 19:03
(Received via mailing list)
I'm assuming you mean in a Controller:

value = @params['tag']

value will contain the value string, not the display string.

Jason
Dfcdb1e3ca91952338d090134b9e0316?d=identicon&s=25 Valen (Guest)
on 2006-06-05 19:21
No, I assume, that I have rhtml file with this tag and want to get
selected value to use it in same rhtml file without using Controller
(DOM model)

Jason Roelofs wrote:
> I'm assuming you mean in a Controller:
>
> value = @params['tag']
>
> value will contain the value string, not the display string.
>
> Jason
This topic is locked and can not be replied to.