Forum: Ruby on Rails beginner drop down list question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
82a578052d304559f15180bdf56555d2?d=identicon&s=25 Tarscher (Guest)
on 2007-01-30 18:45
(Received via mailing list)
hi all,

I want a drop down list with 3 select options.:
<%= select(:variable, :attribute, %w{ Club Ploeg Tak }) %>

I use this selection box in a partial and want to both use it to add
and update records. When updating a record the selection box must thus
be able to select a value by default. Can this be done?

The value, if present is contained in the variable tree.kind

how do I read the selected values in my controller. I don't know what
name the drop down list has.

82a578052d304559f15180bdf56555d2?d=identicon&s=25 Tarscher (Guest)
on 2007-01-31 10:50
(Received via mailing list)
I probably didn't clearly phrase my question:
- I actually want to know how I can read the selected value from the
drop down list. Thus, how do I give the drop down list a name and read
the data in my controller.
- Is it possible to supply a variable that, when matching with the
option list, will be the default selected value?

Thanks in advance
This topic is locked and can not be replied to.