How do I navigate this nested hash without knowing the randomly generated string by ActionController?
<p>I have this params hash:</p>

<pre><code>&gt; profile_params[:videos_attributes]
=&gt; &lt;ActionController::Parameters {"1479515357347"=&gt;&lt;ActionController::Parameters {"vimeo_url"=&gt;"https://vimeo.com/some-awesome-video", "official"=&gt;"true", "_destroy"=&gt;"false"} permitted: true&gt;} permitted: true&gt;
</code></pre>

<p>I am trying to get to the <code>vimeo_url</code> key, but not quite sure how to do that:</p>

<p>I tried these:</p>

<pre><code>&gt; profile_params[:videos_attributes][:vimeo_url]
=&gt; nil
[14] pry(#&lt;ProfilesController&gt;)&gt; profile_params[:videos_attributes]['vimeo_url']
=&gt; nil
</code></pre>

<p>The only thing that works is this:</p>

<pre><code>&gt; profile_params[:videos_attributes]['1479515357347']
=&gt; &lt;ActionController::Parameters {"vimeo_url"=&gt;"https://vimeo.com/some-awesome-video", "official"=&gt;"true", "_destroy"=&gt;"false"} permitted: true&gt;
</code></pre>

<p>But the issue with this is that I believe the string is generated by Rails and I don't know how to reference that from my controller.</p>

<p><strong>Edit 1</strong></p>

<p>Per <a href="http://api.rubyonrails.org/v5.0.0.1/classes/ActionController/Parameters.html" rel="nofollow noreferrer">Rails docs</a>, I even tried the following:</p>

<pre><code>&gt; profile_params[:videos_attributes].fetch(:vimeo_url)
ActionController::ParameterMissing: param is missing or the value is empty: vimeo_url
</code></pre>

<p><strong>Edit 2</strong></p>

<p>Here is the form (truncated for brevity ofcourse) that generates the <code>videos_attributes</code> that I am trying to extract.</p>

<pre><code>    &lt;%= simple_form_for @profile, html: { class: "form-horizontal" } do |f| %&gt;

      &lt;h3 class="text-center"&gt;Videos&lt;/h3&gt;

      &lt;div id="videos" class="text-center"&gt;    
        &lt;%= f.simple_fields_for :videos do |video| %&gt;
          &lt;%= render 'video_fields', f: video %&gt;
        &lt;% end %&gt;
        &lt;div class="links"&gt;
          &lt;%= link_to_add_association 'Add Video', f, :videos, class: "btn btn-success add-grade-button" %&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="form-group"&gt;
          &lt;div class="col-lg-12 text-center"&gt;
            &lt;%= f.button :submit, class: "btn btn-lg btn-primary" %&gt;
          &lt;/div&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
</code></pre>

<p>And the <code>_video_fields.html.erb</code> partial is here:</p>

<pre><code>      &lt;h4&gt;Vimeo&lt;/h4&gt;
          &lt;%= f.input :vimeo_url, as: :text, label: false, input_html: { style: "width: 60%", rows: 1 }, class: 'form-control' %&gt;

            &lt;label class="control-label"&gt;Official Video?&lt;/label&gt;
              &lt;%= f.input_field :official, as: :radio_buttons, class: 'form-control' %&gt;


  &lt;%= link_to_remove_association f do %&gt;
    &lt;i class="fa fa-trash-o fa-lg"&gt;&lt;/i&gt;
  &lt;% end %&gt;
</code></pre>

<p><strong>Edit 3</strong></p>

<pre><code>&gt; profile_params[:videos_attributes].key?(:vimeo_url)
=&gt; false
&gt; profile_params[:videos_attributes].values
=&gt; [&lt;ActionController::Parameters {"vimeo_url"=&gt;"https://vimeo.com/some-awesome-video", "official"=&gt;"true", "_destroy"=&gt;"false"} permitted: true&gt;]
</code></pre>

<p>Not sure how to iterate over the latter to extract the value for <code>vimeo_url</code> which is what I am trying to do.</p>