OK, i have a simple collection_select problem and I''m a newbie to
ruby... I have a form that the user will select a bunch of stuff on to
search through a database.
I can''t figure out how to get the return value out of a
collection_select. Here is the code that displays a drop-down list of
all ip addresses from a table - this works fine. I make my selection
(along with others on the form) and want the result from this
collection_select assigned to the value ipaddr.
@ipAddress.find_all
collection_select ("IpAddress", "ip", @ipaddress, :id,
"ip") ** this
works fine, everthing displays
In my controller, I do:
@ipaddr = params[:ip]
This is obviously wrong as I get an error saying "Select * from
ip_addresses where (ip_addresses.ip is NULL) ????
If I use a text input box with the following code, everything works
fine, so I''m pretty sure the controller code is ok - just
don''t know how
to get the result code from collection_select.
<input type="text" name="ipaddr"> ** this works,
but I don''t want
the user to have to type the IP address in - I want them all displayed
to choose from. Thanks.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---