title: Rails 5, access params hash
body: <p>I think I'm loosing it here ... so I have a params hash, that I want to use in a controller:</p>
  
  <p><em>Parameters:
  {"utf8"=>"✓",  "_method"=>"patch",  "authenticity_token"=>"etcetc",  "scan"=>   {"1"=>{"scan_id"=>"40", "organisation_id"=>"1", "select_scan"=>"false", "role"=>""},    "2"=>{"scan_id"=>"40", "organisation_id"=>"2", "select_scan"=>"false", "role"=>""},    "3"=>{"scan_id"=>"40", "organisation_id"=>"3", "select_scan"=>"false", "role"=>""},    "number"=>"222",    "description"=>"nice!",  "expert"=>"for dummies",    "decentralisation"=>"0"},  "commit"=>"Update Scan",  "id"=>"40"}</em></p>
  
  <p>Now, if return to my view an instance variable, with value:</p>
  
  <pre><code>@q = params[:id]
  </code></pre>
  
  <p>that gives me '40', as expected.</p>
  
  <pre><code>@q = params['id']
  </code></pre>
  
  <p>also give me '40'</p>
  
  <p>BUT, that's the only param value I can access? Every other value gives me nil, or an error like:</p>
  
  <pre><code> @q = params[:scan][:number] # =&gt; undefined method `[]' for nil:NilClass
  @q = params['scan']['1'][:role] # =&gt; undefined method `[]' for nil:NilClass
      @q = params[:scan].to_a # =&gt; []
  @q = params[:scan].class # =&gt; NilClass
  </code></pre>
  
  <p>I've read about strong params, and all params are permitted, but still, no values are returned?</p>