title: Flash message with html_safe from the controller in Rails 4 (safe version)
body: <p>In my controller I have the following code:</p>
  
  <pre class="lang-rb prettyprint-override"><code>    format.html { redirect_to new_customer_url,
                  notice: %Q[ A customer already exists with with this shopping id. Edit this customer #{view_context.link_to("here", edit_customer_url(@duplicate))}.
      ].html_safe
  </code></pre>
  
  <p>I would like to be able to include a link in a flash message, so (as you can see) I call html_safe to unescape the string.  However, it seems that as of Rails 4.1 this is now handled differently.  (See <a href="https://groups.google.com/forum/#!topic/rubyonrails-core/z52zgDgUmbs" rel="nofollow noreferrer">here</a> and <a href="http://blog.bigbinary.com/2014/07/24/flash-access-changes-rails-4-1.html" rel="nofollow noreferrer">here</a>)</p>
  
  <p>A solution to this has been provided in <a href="https://stackoverflow.com/questions/24887814/rails-4-link-in-flash-message-is-not-parsed-as-html?answertab=votes#tab-top">this question</a>. However, it only does so by moving the <code>html_safe</code> call to the view, having the effect of unescaping all flash messages.  </p>
  
  <p>I would prefer to be a bit more paranoid than that, is there any way to include the link in the flash message from the controller?</p>