title: Couldn't find Category without an ID Error message
body: <p>I'm new to Ruby on Rails, and I'm experiencing some problems</p>
  
  <p>I'm trying to affect a cathogory id to an object. </p>
  
  <p>So this is my controller action:</p>
  
  <pre><code>  def create_card
      @card = Card.new(params[:card])
  
      if !params[:category].blank?
       @card.category_id = params[:category_id]
      end
      @category = Category.find(params[:id])
      @card.category_id = @category.id
      @card.save
  
      if @card.save
        flash[:notice] = "Card created"
        redirect_to :action =&gt; "card_information", :id =&gt; @card.id
      else
        render new_card_path
      end 
    end
  </code></pre>
  
  <p>And this is my view piece of code:</p>
  
  <pre><code>= form_for @card, :url =&gt; create_card_path do |f|
    .row
      .span3
        = f.label "Card name"
        = f.text_field :title
  
    .row    
      .span3
        = f.label "Card Category"
        = select_tag :category_id, options_for_select(Category.all.collect{ |c| [c.title, c.id]})
  
  
    %br/
   .row
     .span3
       = f.submit "Submit", :class =&gt; "btn btn-primary"
  </code></pre>