Forum: Ruby on Rails h() aka. html_escape in controller code?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Zack C. (Guest)
on 2006-01-13 23:42
(Received via mailing list)

In controller code I'm doing things like:

  flash[:success] = "Customer {} has been deleted."

I know how to escape html in views by using the h() method.  How can I
the same thing here in the controller?

Ed C. (Guest)
on 2006-01-14 05:42
(Received via mailing list)
I don't think you would do it there -- instead, add
"h(flash[:success])" to your view. (Keep the presentation separate.)
This topic is locked and can not be replied to.