title: Rails4: How to permit a hash with dynamic keys in params?
body: <p>I make a http put request with following parameters:</p>
  
  <blockquote>
    <p>{"post"=>{"files"=>{"file1"=>"file_content_1",
    "file2"=>"file_content_2"}}, "id"=>"4"}</p>
  </blockquote>
  
  <p>and i need to permit hash array in my code. 
  based on <a href="https://github.com/rails/strong_parameters" rel="noreferrer">manuals</a> I've tried like these:</p>
  
  <pre><code>&gt; params.require(:post).permit(:files) # does not work
  &gt; params.require(:post).permit(:files =&gt; {}) # does not work, empty hash as result
  &gt; params.require(:post).permit! # works, but all params are enabled
  </code></pre>
  
  <p>How to make it correctly?</p>
  
  <p><strong>UPD1</strong>: file1, file2 - are dynamic keys</p>