title: Rails Polymorphic Assignment
body: <p>I've had success creating dependent polymorphic associations using <code>accepts_nested_attributes_for</code>, but now I would like to assign an already existing polymorph.  I'm getting the error:</p>
  
  <pre><code>undefined method `id' for {"id"=&gt;"4"}:ActiveSupport::HashWithIndifferentAccess
  </code></pre>
  
  <p>Models:</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
    has_one :address, :as =&gt; :addressable
  end
  
  class Company &lt; ActiveRecord::Base
    has_one :address, :as =&gt; :addressable
  end
  
  class Address &lt; ActiveRecord::Base
    belongs_to :addressable, :polymorphic =&gt; true
  end
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;%= form_for @company do |f| %&gt;
    &lt;p&gt;
      &lt;%= f.label :company_name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :company_name %&gt;
    &lt;/p&gt;
  
    &lt;%= f.fields_for :address do |f| %&gt;
      &lt;div class="field"&gt;
        &lt;%= f.collection_select :id, Address.all, :id, :description, {:prompt =&gt; "-Select Address"} %&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  </code></pre>
  
  <p>The resulting params hash is:</p>
  
  <pre><code>"company"=&gt;{"company_name"=&gt;"myCompanyName", "address"=&gt;{"id"=&gt;"4"}}
  </code></pre>
  
  <p>Which looks reasonable to me.  What am I doing wrong?</p>