title: can't get a belongs_to model to save as part of the has_one form
body: <p>I've got an Event and Activity. Each event has one activity, and the user needs to pick from a large number of activities. I've got a collection_select field that shows properly in the Event form, but it won't save. I keep getting a <code>Couldn't find Activity without an ID</code> error.</p>
  
  <p>I thought that by creating the has_one belongs_to association in my models that the forms would automatically know what to do. Nope. So I started adding methods to the Events controller, not even knowing if they are correct. But things didn't break.</p>
  
  <p>Now I'm thinking that I probably need to create a local variable in the form, but I've tried a dozen variations and can't get anything to work. I just end up getting other error messages.</p>
  
  <p>My Event model</p>
  
  <pre><code>class Event &lt; ActiveRecord::Base
  
    attr_accessible :date, :activity
  
    has_one :activity
    belongs_to :creator, :class_name =&gt; "User"
    has_many :attendees, :class_name =&gt; "User"
    has_many :comments
  end
  </code></pre>
  
  <p>Activity model</p>
  
  <pre><code>class Activity &lt; ActiveRecord::Base
    attr_accessible :location, :title, :image, :image_cache
  
    mount_uploader :image, ImageUploader
  
    belongs_to :event
  end
  </code></pre>
  
  <p>part of Events controller</p>
  
  <pre><code>def new
    @event = Event.new
    @activities = Activity.find(:all, :order =&gt; 'title')
  
  end
  
  def create
    @event = Event.new(params[:event])
    @activities = Activity.find(:all, :order =&gt; 'title')
    @activity = Activity.find(params[:id])
  end
  </code></pre>
  
  <p>Events form</p>
  
    
  
  <pre><code>&lt;div class="field"&gt;
    &lt;h6&gt;When do you want to go?&lt;/h6&gt;&lt;br /&gt;
    &lt;%= f.text_field :date %&gt;
  &lt;/div&gt;
  &lt;h5&gt;Activities&lt;/h5&gt;
  
  &lt;%= collection_select(:activity, :event_id, Activity.all, :id, :title, {:include_blank =&gt; 'Please Select'} ) %&gt;
  
  
  &lt;div class="actions"&gt;
    &lt;%= f.submit %&gt;
  &lt;/div&gt;
  </code></pre>
  
    
  
  <p>Wherein lies my ignorance?</p>