title: Rails 6: form with remote: true and Turbolinks not showing flash after redirect
body: <p>I have <code>&lt;%= simple_form_for @offer, remote: true %&gt;</code> with Turbolinks enabled. I'm trying to redirect and show success flash with something like this in my <code>update</code> action:</p>
  
  <pre><code>respond_to do |format|
    if @offer.update(offer_params)
      flash[:success] = "#{@offer.name} #{t(:updated)}"
      format.html { redirect_to seller_offers_path }
      format.js
    else
      format.html { render :edit }
    end
  end
  </code></pre>
  
  <p>My <code>update.js.erb</code> has code not related to redirect or flash:</p>
  
  <pre><code>$(".ibox-content.actions").removeClass('sk-loading');
  $('.sk-spinner').css("display", "none");
  </code></pre>
  
  <p>In application.html.erb I can render flash with this:</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;% flash.each do |message_type, message| %&gt;
       &lt;%= content_tag(:div, content_tag(:strong, message), id: "flash_message",
                     class: "text-bold alert alert-#{message_type}") %&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>At the moment my form is saved, however no redirect. </p>
  
  <p>When I add <code>Turbolinks.visit(&lt;%= seller_offers_path %&gt;)</code> in <code>update.js.erb</code> form is saved, redirect is done, however there is no flash.</p>
  
  <p><strong>Is there a way I can have flash shown on redirected page with Turbolinks and <code>remote: true</code> , please?</strong> So far I've tried <a href="https://stackoverflow.com/a/43418407">this suggestion</a>, however it works only for showing flash on same page - it doesn't work with <code>redirect_to</code>.</p>
  
  <p><strong>Update</strong></p>
  
  <p>This does redirect, however no flash:</p>
  
  <pre><code>respond_to do |format|
    if @offer.update(offer_params)
      format.js { redirect_to seller_offers_path, success: "#{@offer.name} #{t(:updated)}" }
    else
      format.html { render :edit }
    end
  end
  </code></pre>
  
  <p><strong>Update 2</strong></p>
  
  <p>At the moment I'm trying to implement something like
  <code>Turbolinks.visit(url, { keep: 'flash' });</code> as <a href="https://www.rubydoc.info/github/rails/turbolinks" rel="nofollow noreferrer">mentioned in docs</a>, however doesn't seem to be working with Turbolinks 5.2</p>
  
  <p><strong>Update 3</strong></p>
  
  <p>I've removerd <code>update.js.erb</code> and in my controller I have</p>
  
  <pre><code>def update
    if @offer.update(offer_params)
      flash[:success] = "#{@offer.name} #{t(:updated)}"
      redirect_to seller_offers_path
    else
      render :edit
    end
  end
  </code></pre>
  
  <p>Redirect is done as expected, however still no flash displayed on <code>index</code>. I can print my flash at the end of <code>update</code> action:</p>
  
  <p><code>#&lt;ActionDispatch::Flash::FlashHash:0x00007f180d2a1c60 @discard=#&lt;Set: {}&gt;, @flashes={"success"=&gt;"My offer updated!"}, @now=nil&gt;</code></p>
  
  <p>however at the end of <code>index</code> action (where I redirect_to) it is empty:</p>
  
  <p><code>#&lt;ActionDispatch::Flash::FlashHash:0x00007f180eb3b780 @discard=#&lt;Set: {}&gt;, @flashes={}, @now=nil&gt;</code></p>
  
  <p>Looks like my flash is not kept for next request. Is it because of Turbolinks, or other some reason? I'd be happy for any hint.</p>