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.
Valen (Guest)
on 2006-06-05 20: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?
Jason R. (Guest)
on 2006-06-05 21: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
Valen (Guest)
on 2006-06-05 21: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 R. 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.