title: ActiveModel::ForbiddenAttributesError in Rails 4?
body: <p>I am getting the following error when trying to update a Rails model via the ActiveModel update method:</p>
  
  <pre><code>ActiveModel::ForbiddenAttributesError
  </code></pre>
  
  <p>I am aware of the strong parameters requirement in Rails 4 per the link below, but how do I whitelist the params in my case - an array of hashes?  I cannot make sense of the documentation.</p>
  
  <p><a href="http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters" rel="nofollow">http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters</a></p>
  
  <p>Here are the json params that I am trying to process:</p>
  
  <pre><code>{
      id: 1,
      month: 'April',
      measurements: [
          { id: 1, name: 'PT', location_1: '1.1', location_2: '1.2' },
          { id: 1, name: 'OT', location_1: '1.1', location_2: '1.2' },
          .
          .
      ]
  }
  </code></pre>
  
  <p>Controller action:</p>
  
  <pre><code>  def update
  
      #Trying to update all measurements associated with this parent object
  
      #params.permit(measurements: [{ :name, :location_1, :location_2 } ])
      #This attempt causes a syntax error
  
      measurements = params[:measurements]
  
      measurements.each do |measurement|
        current_measurement = Measurement.find(measurement[:id])
        new_measurement = measurement.except(:id) 
  
        current_measurement.update(new_measurement)
      end
      .
      .
  
    end
  </code></pre>