title: Rails 3 Nested Models unknown attribute Error
body: <ul>
  <li>I have a model "Issue" and a nested Model "Relationship"</li>
  <li><p>In the issue.rb I have mentioned:</p>
  
  <pre><code>has_many :relationships, :dependent =&gt; :destroy
  accepts_nested_attributes_for :relationships, :allow_destroy =&gt; true
  </code></pre></li>
  <li><p>In relationship.rb I have mentioned:</p>
  
  <pre><code>belongs_to :issue
  </code></pre></li>
  <li><p>Following Ryan Bates Railcast#196 I have the following in my issues_controller:</p>
  
  <pre><code>relationship = @issue.relationships.build
  </code></pre></li>
  </ul>
  
  <p>However, I am encountering an error "unknown attribute: relationship"</p>
  
  <p>Am I doing something incorrectly here? I do see the Relationships Attributes being passed to the server in the log however, this error does not let the create to be successful.</p>
  
  <p>My expertise with rails is beginners level so kindly excuse me if I am asking a question which maybe deemed trivial.</p>
  
  <p>Thanks for the help.</p>
  
  <p><strong>EDIT</strong>: The relevant Controller code:</p>
  
  <pre><code>    @relationship = @issue.relationships.build
      #@relationship = Relationship.new(params[:relationship])
      if @relationship.issue_id = ''
        @relationship.issue_id = @issueid
      end
  
      if @relationship.cause_id = ''
        @relationship.cause_id = @issueid
      end
  
      @relationship.save
      redirect_to(:back, :notice =&gt; 'New Relationship was created') 
  </code></pre>
  
  <p>What I see on the trace:</p>
  
  <pre><code>    ActiveRecord::UnknownAttributeError in IssuesController#create
      unknown attribute: relationship
  </code></pre>
  
  <p>Among the Issue parameters, I see the Relationship params being passed as expected:</p>
  
  <pre><code>    "relationship"=&gt;{"issue_id"=&gt;"100",
      "cause_id"=&gt;""}
  </code></pre>
  
  <p><strong>ANOTHER UPDATE</strong>
  Posting the form_for code:</p>
  
  <pre><code>    - form_for Issue.new do |f|
  
        .field  
          = f.text_field :description, :class=&gt;"formfield", :id=&gt;"frm_descr"
  
        .field  
          = f.hidden_field :wiki_url, :class=&gt;"formfield", :id=&gt;"frm_wiki_url"
  
        .field
          = f.hidden_field :short_url, :class=&gt;"formfield", :id=&gt;"frm_img_url"
  
        .field
          = f.hidden_field :title, :class=&gt;"formfield", :id=&gt;"frm_title"         
  
        = f.fields_for :relationship do |builder|
          = builder.text_field :issue_id, :class=&gt;"form_field", :id=&gt;"frm_rel_issue_id", :value=&gt;@issue.id 
          = builder.text_field :cause_id, :class=&gt;"form_field", :id=&gt;"frm_rel_cause_id"
  
        .actions
          = f.submit 'Create', :class=&gt;"save_button", :name=&gt;"save_issue_rel_button", :id=&gt;"val_collector"
  </code></pre>