title: Display flash alert from controller's concern
body: <p>I've a controller concern which regroup the logic for access control:</p>
  <pre class="lang-rb prettyprint-override"><code>module AccessControl
    extend ActiveSupport::Concern
  
    def restrict
      unless current_user
        flash.now[:danger] = 'You must log in first'
        redirect_to :root
      end
    end
  end
  </code></pre>
  <p>which is included in some controllers and used as <code>before_action</code> filter</p>
  <pre class="lang-rb prettyprint-override"><code>class SomeController &lt; ApplicationController
    include AccessControl
  
    before_action :restrict
  end
  </code></pre>
  <p>But somehow the flash message is not showing up (other flash messages are properly displayed if they're called from Controllers).</p>
  <p>Any idea about why I can't call a flash message from a Concern ? If it's not the expected/recommended implementation, how could I've DRY controllers but still have flash messages displayed ?</p>
  <p>Haven't found the answer inside <a href="https://api.rubyonrails.org/v6.1.0/classes/ActiveSupport/Concern.html" rel="nofollow noreferrer">ActiveSupport::Concern</a>'s nor <a href="https://api.rubyonrails.org/classes/ActionDispatch/Flash/FlashHash.html" rel="nofollow noreferrer">ActiveDispach::Flash</a>'s documentation. I'm trying some alternatives but none of them are actually working.</p>