title: How can I get the value of a key which is into a hash that is into params hash in rails?
body: <p>When I edit the values using a form, rails calls update method and makes the following hash. How can I get the value of  <code>v_tipo_control_id</code> which is into the <code>f_controls_attributes</code>'s hash? The <code>f_controls</code> values are got using <code>fields_to</code>.</p>
  <pre><code>  Processing by TLogicaldevicesController#update as HTML
    Parameters: {
      &quot;utf8&quot;=&gt;&quot;✓&quot;, &quot;authenticity_token&quot;=&gt;&quot;PqSHE3BAXUfcIN0MDh7AWnPT4HyGMpGKW9TkezArK2xJavrqSOUc7l5wnGX3XXVJp6M0prNp7pZZiVTYzmHc4g==&quot;, 
       &quot;t_logicaldevice&quot;=&gt;{&quot;f_element_id&quot;=&gt;&quot;43&quot;, 
         &quot;f_controls_attributes&quot;=&gt;
                  {
                   &quot;0&quot;=&gt;{&quot;v_tipo_control_id&quot;=&gt;&quot;1&quot;, &quot;hour_start_on&quot;=&gt;&quot;&quot;, &quot;v_ortoocaso_id_on&quot;=&gt;&quot;&quot;,
                   &quot;v_magnitudrep_id_on&quot;=&gt;&quot;&quot;, &quot;v_tipoejecucion_id_on&quot;=&gt;&quot;&quot;,
                  &quot;off_set_on&quot;=&gt;&quot;&quot;, &quot;repeat_on&quot;=&gt;&quot;&quot;, &quot;rep_offset_on&quot;=&gt;&quot;&quot;, &quot;v_accion_id&quot;=&gt;&quot;&quot;}}},
                    &quot;total_controles&quot;=&gt;&quot;2&quot;, &quot;commit&quot;=&gt;&quot;Guardar&quot;, &quot;id&quot;=&gt;&quot;75&quot;
                }
  </code></pre>
  <p>I try:</p>
  <pre><code>params[:f_controls][:v_tipo_control_id] 
  
  params[:f_controls_attributes]
  </code></pre>
  <p>but both show <code>f_controls</code> as <code>nil</code> so I can't get <code>v_tipo_control_id</code> value.</p>
  <h2>Update:</h2>
  <p>That works! Thanks mudasobwa. But the problem is if I have some f_controls like...</p>
  <pre><code>&quot;f_controls_attributes&quot;=&gt;{
      &quot;0&quot;=&gt;{&quot;f_element_id&quot;=&gt;&quot;&quot;, &quot;v_tipo_control_id&quot;=&gt;&quot;3&quot;, &quot;hour_start_on&quot;=&gt;&quot;&quot;, &quot;v_ortoocaso_id_on&quot;=&gt;&quot;&quot;, 
             &quot;v_magnitudrep_id_on&quot;=&gt;&quot;&quot;, &quot;v_tipoejecucion_id_on&quot;=&gt;&quot;&quot;, &quot;off_set_on&quot;=&gt;&quot;&quot;, &quot;repeat_on&quot;=&gt;&quot;&quot;, &quot;rep_offset_on&quot;=&gt;&quot;&quot;, 
       &quot;v_accion_id&quot;=&gt;&quot;&quot;, &quot;id&quot;=&gt;&quot;106&quot;}, 
      &quot;1&quot;=&gt;{&quot;f_element_id&quot;=&gt;&quot;&quot;, &quot;v_tipo_control_id&quot;=&gt;&quot;1&quot;, &quot;hour_start_on&quot;=&gt;&quot;&quot;, &quot;v_ortoocaso_id_on&quot;=&gt;&quot;&quot;, 
          &quot;v_magnitudrep_id_on&quot;=&gt;&quot;&quot;, &quot;v_tipoejecucion_id_on&quot;=&gt;&quot;&quot;, &quot;off_set_on&quot;=&gt;&quot;&quot;, &quot;repeat_on&quot;=&gt;&quot;&quot;, &quot;rep_offset_on&quot;=&gt;&quot;&quot;, 
       &quot;v_accion_id&quot;=&gt;&quot;&quot;, &quot;id&quot;=&gt;&quot;107&quot;}}}
  </code></pre>
  <p>In this example I have two f_control hashes. Do I have to write the number value manual? Is there any other form more automatically? Because not always I know the exactly number of f_control.</p>
  <p>Actually, when there are serveral, I need to know the ones that I update only. But I don't know if there is any option to know that. Is there any option?</p>
  <p>Thanks!</p>