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

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.
Steven R. (Guest)
on 2005-12-15 21:37
(Received via mailing list)
I'm sure this is an easy question to answer but here is what I am trying

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
in the logs it has

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

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

a little background: Its an email campaign app where there is a table
"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

Steven R.
web application & interface developer
[phone] 404-488-4364
This topic is locked and can not be replied to.