Forum: Ruby on Rails Newbie - populating select list from db - BUMP :)

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.
Ecae5e4b5fcfcc730b4f66061f91ee8a?d=identicon&s=25 Dan Apostol (Guest)
on 2006-03-23 11:04
(Received via mailing list)
Hi!

in the same problem with a select with some values from db:

the following select in test.rhtml:

<%= select(:listSetting, :code, @listSettings) %>

where

@listSettings  = ListSetting.find(:all, :order => "code").map {|u|
[u.code, u.id] }


i have an observer_field defined in test.rhml as below:

<%= observe_field("listSetting_code",
       :update => "values_span",
       :url => {:action => :listSetting_code}
       )
    %>
which will observe the select object and run the code from
ListSetting_code method from controller.

the log after changing the select is as below:

Processing ListAdminController#listSetting_code (for 127.0.0.1 at
2006-03-22 14:39:17) [POST]
 Parameters: {"action"=>"listSetting_code", "value"=>"listSetting_code",
"1"=>"", "controller"=>"list_admin"}

2 short n00b questions:

1. what it means "1"=>"" in the log file?
2. how do I get the value of option selected in controller method?

TIA.

Dan
This topic is locked and can not be replied to.