ruby on rails - Trouble inserting code in a flash notice -
ruby on rails - Trouble inserting code in a flash notice -
i have flash notice in controller. notice includes mail_to
helper method. couldn't helper work without placing view_context
before it. works in browser outputs html tags string instead of processing html.
in other words, in controller have:
flash[:notice] = "blabla #{view_context.mail_to setting::email} blabla."
but when gets called see in browser's flash notice:
blabla <a href="mailto:me@example.com">me@example.com</a> blabla
any suggestions?
i.e. alter to:
flash[:notice] = "blabla #{view_context.mail_to setting::email} blabla.".html_safe
ruby-on-rails ruby-on-rails-4
Comments
Post a Comment