title: Rails: Unpermitted parameter in Rails 5
body: <p>First of all I want simply get an object inside the current object that I'm sending to my <em>backend</em>.</p>
  
  <p>I have this simple <code>JSON</code> (generated from a form):</p>
  
  <pre><code>{
    "name": "Project 1",
    "project_criteria": [
      {
        "name": "Criterium 1",
        "type": "Type 1",
        "benefit": "1"
      },
      {
        "name": "Criterium 2",
        "type": "Type 2",
        "benefit": "3"
      }
    ]
  }
  </code></pre>
  
  <p>My <code>classes</code>:</p>
  
  <pre><code>class Project &lt; ApplicationRecord
    has_many :project_criteria
    accepts_nested_attributes_for :project_criteria
  end
  
  class ProjectCriterium &lt; ApplicationRecord
    belongs_to :project
  end
  </code></pre>
  
  <p><strong>ProjectsController:</strong></p>
  
  <pre><code>def project_params
    params.require(:project).permit(:name,  project_criteria: [] )
  end
  </code></pre>
  
  <p>But I still can't access <code>project_criteria</code> parameter as you can see below:</p>
  
  <pre><code>Started POST "/projects" for 127.0.0.1 at 2016-08-19 16:24:03 -0300
  Processing by ProjectsController#create as HTML
    Parameters: {"project"=&gt;{"name"=&gt;"Project 1", "project_criteria"=&gt;{"0"=&gt;{"benefit"=&gt;"1", "name"=&gt;"Criterium 1", "type"=&gt;"Type 1"}, "1"=&gt;{"benefit"=&gt;"3", "name"=&gt;"Criterium 2", "type"=&gt;"Type 2"}}}}
  Unpermitted parameter: project_criteria # &lt;-----------
  </code></pre>
  
  <p><strong>Note:</strong></p>
  
  <p>By the way, I already tried to use <strong>criterium</strong> instead of <strong>criteria</strong>(which <strong>- in my opinion -</strong> is the correct since it should be pluralized) in <code>has_many</code> and <code>accepts_nested_attributes_for</code>, but it also doesn't work.</p>
  
  <p>Does someone have a solution for this?</p>