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

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

In controller code I'm doing things like:

  flash[:success] = "Customer {#@customer.name} has been deleted."

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

Thanks,
Zack
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.