Beginner drop down list question

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.


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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs