title: In a Hotwire/Rails app, when to use target: '_top' for a turbo_frame?
body: <p>The turbo handbook explains <code>target: '_top'</code>  <a href="https://turbo.hotwire.dev/handbook/frames#targeting-navigation-into-or-out-of-a-frame" rel="nofollow noreferrer">here</a> and <a href="https://turbo.hotwire.dev/reference/frames#frame-that-drives-navigation-to-replace-whole-page" rel="nofollow noreferrer">here</a>.</p>
  <p>But I still don't understand what's the difference between these two forms:</p>
  <p>#1</p>
  <pre><code>&lt;%= turbo_frame_tag 'new_search', target: '_top' do %&gt;    
    &lt;%= search_form_for :q do |f| %&gt;
      ...
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  <p>#2</p>
  <pre><code>&lt;%= search_form_for :q do |f| %&gt;
    ...
  &lt;% end %&gt;
  </code></pre>
  <p>Both form will send a normal HTML format request via GET method, and the whole page will be replaced by Turbo Drive. So their behavior looks quite similar in this case.</p>
  <p>Is <code>target: '_top'</code> only useful when I need to lazy load something via the <code>src</code> attribute of Turbo Frame while I want the content navigate outside the frame? :</p>
  <pre><code>&lt;%= turbo_frame_tag 'something', src: '/something', target: '_top' %&gt;
  </code></pre>