Forum: Ruby on Rails getting a value from a select list

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.
E6520b0addebfd58b83d7f2dc8d91b01?d=identicon&s=25 Steven Ross (Guest)
on 2005-12-15 20:37
(Received via mailing list)
I'm sure this is an easy question to answer but here is what I am trying
to
do:

I am using this method:

@newsletters = Newsletter.find(:all, :order => 'name')
 collection_select(:newsletter, :id, @newsletters, :id, :name)

I can't seem to get the id out of the :newsletter param. When i see the
post
in the logs it has

Parameters: {"commit"=>"Create", "action"=>"create",
"campaign"=>{"name"=>"test"}, "controller"=>"admin/campaign",
"newsletter"=>{"name"=>"2"}}

how do i get the 2 out of the newsletter param?

a little background: Its an email campaign app where there is a table
with
"newsletters" (name, url, etc) and another table "campaigns" which
refererences (belongs_to) the newsletters table. A campaign can only
reference one newsletter but, additional campaigns can reference the
same
newsletter.

thanks
--
Steven Ross
web application & interface developer
http://www.zerium.com
[phone] 404-488-4364
This topic is locked and can not be replied to.