title: Rails 4 NOT updating nested attributes
body: <p><strong>Issue:</strong> Instead of <em>updating</em> nested attributes, they are being <em>created</em> on top of the existing nested attributes when I hit the <code>#update</code> action of the associated <code>features_controller.rb</code></p>
  
  <p><strong>Likely Cause:</strong> I think the problem lies in my lack of understanding in Rails' <code>form_for</code>. I think the breakdown is in my views, how I render the persisting nested attributes, and/or <strong>how I fail to specify the nested attribute's id, causing it to simply create a new one</strong> </p>
  
  <p><strong>feature.rb</strong></p>
  
  <pre><code>class Feature &lt; ActiveRecord::Base
    ...
    has_many :scenarios
    accepts_nested_attributes_for :scenarios,
      allow_destroy: true,
      reject_if: :all_blank
    ...
  end
  </code></pre>
  
  <p><strong>features_controller.rb</strong></p>
  
  <pre><code>def update
    ...
    project = Project.find(params[:project_id])
    @feature = Feature.find(params[:id])
  
    if @feature.update_attributes(feature_params)
      # checking feature_params looks good...
      # feature_params['scenarios'] =&gt; { &lt;correct object hash&gt; }
  
      redirect_to project
    else
      render :edit
    end
  end
  
  ...
  
  private
  def feature_params
    params.require(:feature).permit(:title, :narrative, :price, :eta, scenarios_attributes[:description, :_destroy])
  end
  </code></pre>
  
  <p><strong>_form.html.haml (simplified)</strong></p>
  
  <pre><code>= form_for [@project, @feature] do |f|
    ...
    - if @feature.new_record? -# if we are creating new feature
      = f.fields_for :scenarios, @feature.scenarios.build do |builder|
        = builder.label :description, "Scenario"
        = builder.text_area :description, rows: "3", autocomplete: "off"
  
    - else -# if we are editing an existing feature
      = f.fields_for :scenarios do |builder|
        = builder.label :description, "Scenario"
        = builder.text_area :description, rows: "3", autocomplete: "off"
  </code></pre>
  
  <p>I'm sure there's a nicer way to achieve the <code>if @feature.new_record?</code> check. I'm also using a few Javascript hooks to create dynamic nested attribute forms (which I've left out), heavily influenced by <a href="http://railscasts.com/episodes/196-nested-model-form-revised?view=asciicast" rel="noreferrer">Railscast #196 Nested Model Form (revised)</a></p>
  
  <p>I would love a really nice <em>Rails-y</em> implementation of dealing with these sorts of nested forms.</p>