title: Set flash error from Rack::Attack response?
body: <p>I'm trying to set a flash[:error] to give feedback to the user.  I haven't been able to find info on how to implement.  One workaround I'm doing is to redirect with query params and pick that up in the controller, but it's brittle and I'm getting some errors,  turbolinks sometimes makes the message render twice.</p>
  <pre><code>  # rack_attack.rb
    Rack::Attack.throttled_response = lambda do |env|
  
      headers = {
        'Location'=&gt; &quot;/pages/home?error=#{throttle_type}&quot;
      }
      [301, headers, []]
    end
  </code></pre>
  <p>What's the best way to set a flash message when a user is throttled?</p>