title: Unpermitted parameter error (strong params)
body: <p>I have a form:</p>
  
  <pre><code>= simple_form_for @character do |f|
      = f.input :name
      = f.input :description
      = f.simple_fields_for @movie_characters do |fmc|
          = fmc.association :movie, value_method: :id, label_method: :title
      = f.submit
  </code></pre>
  
  <p>Relationship here is Character has many MovieCharacters and MovieCharacter belongs_to Movie.</p>
  
  <p>params I get from this form look like this:</p>
  
  <pre><code>{"utf8"=&gt;"✓", "_method"=&gt;"patch", "authenticity_token"=&gt;"6d8n1Z5AC3nF/cqzTInnMr5TyRhZFcGV8ssf5CsNkjskiD9lUL10nVDYeV4i0yS85Q87yNcIi+coFFDf0mpZ4w==", "character"=&gt;{"name"=&gt;"Joker", "description"=&gt;"best villain ever", "movie_character"=&gt;{"movie_id"=&gt;"1"}}, "commit"=&gt;"Update Character", "controller"=&gt;"characters", "action"=&gt;"update", "id"=&gt;"1"}
  </code></pre>
  
  <p>character_params method looks like this:</p>
  
  <pre><code>def character_params
          params.require(:character).permit(:name, :description, movie_characters_attributes: [:movie_id, :character_id])
      end
  </code></pre>
  
  <p>Unfortunately while calling this method in controller I get "Unpermitted parameter: movie_character" warning.
  I also tried</p>
  
  <pre><code>def character_params
              params.require(:character).permit(:name, :description, movie_characters: [:movie_id, :character_id])
          end
  </code></pre>
  
  <p>But effects are the same. Can you tell me why it doesnt work?</p>
  
  <p>UPDATE:</p>
  
  <pre><code>class Character &lt; ActiveRecord::Base
      has_many :movie_characters
  
      accepts_nested_attributes_for :movie_characters
  end
  
  class MovieCharacter &lt; ActiveRecord::Base
    belongs_to :character
    belongs_to :movie
  end
  </code></pre>