title: Access value inside params hash
body: <pre><code>Rails 5
  </code></pre>
  
  <p>I am trying to access one of the params</p>
  
  <pre><code>Parameters: {
    "utf8"=&gt;"✓", "authenticity_token"=&gt;".......", 
    "temp_file_path"=&gt;"{:value=&gt;\"/home/utils/rails/fw_export/tmp/1510608598.csv\"}", 
    "button"=&gt;""
  }
  </code></pre>
  
  <p>specifically, temp_file_path. I tried:</p>
  
  <pre><code>temp_file_path = params[:temp_file_path][:value]
  </code></pre>
  
  <p>But I am getting an error:</p>
  
  <pre><code>TypeError (no implicit conversion of Symbol into Integer):
  </code></pre>
  
  <p>How do I access the value?</p>
  
  <p>I also tried params["temp_file_path"][:value]</p>
  
  <h1>Solution:</h1>
  
  <p>I was passing the temp_file_file path as part of the params, as follows (from a View):</p>
  
  <pre><code>= hidden_field_tag :temp_file_path, :value =&gt; temp_file_path
  </code></pre>
  
  <p>I changed it to:</p>
  
  <pre><code> = hidden_field_tag :temp_file_path, temp_file_path
  </code></pre>
  
  <p>and  now the value is accessible as:</p>
  
  <pre><code>params[:temp_file_path]
  </code></pre>