title: Unwrap Rails POST params hash and map to model attributes w/ strong parameters
body: <p>I am building a rails4 api where i am posting a nested hash of attributes. however, the model does not actually have nested attributes or an association. Attempting to make a cleaner post params hash by combining some attributes into a group, but have the api handle the unwrapping and strong parameters validation.</p>
  
  <pre><code>## Example POST params
  params[:item][:group] = {
    a: true,
    b: false
  }
  </code></pre>
  
  <p>But the model does not actually have a <code>group</code> column, the attributes <code>a</code> and <code>b</code> are attributes directly on the model.</p>
  
  <p>to handle this without the <code>group</code> wrapper would simply be</p>
  
  <pre><code>params.require(:item).permit(:a, :b)
  </code></pre>
  
  <p>But I would like to have it pass <code>strong_parameters</code> submitted with the <code>group</code> wrapper. How can I achieve this but having the POST params as mentioned above?</p>