Cannot associate new records

After looking at a list of feeds, clicking on a specific feed gives an
interface to assign a tag to that feed with checkboxes. So far so good,
but http://localhost:3000/feeds/add_some_tags/1 gives:

ActiveRecord::HasManyThroughCantAssociateNewRecords in

Cannot associate new records through 'Feed#colors' on '#'. Both records
must have an id in order to create the has_many :through record
associating them.

That's all well and good, but both records do have an id, of course.
However, how do I get those id's and put them into the join table
(colors)? Now, this is getting interesting because it's starting to deal
with the db directly. The models are at:
svn/trunk/app/models/ and look fine to me.

Part of the controller:

thufir@arrakis ~/Desktop/strawr $
thufir@arrakis ~/Desktop/strawr $ tail app/controllers/
feeds_controller.rb -n 20

def add_some_tags
  @feed = Feed.find(params[:id])
  @unused_tags =
    Tag.find(:all) - @feed.tags

  if @unused_tags.any?
    @tags_to_add = { |tag|
      (@params['tag']['checked'] == '1')}
    @tags_to_add.each { |tag|
      @feed.tags << Tag.find_or_create_by_tag(params[:which_tag])}

  if @tags_to_add.any? and
    flash[:notice] = 'Tags have been added!'
  redirect_to :action => 'show', :id => @feed

thufir@arrakis ~/Desktop/strawr $