How can I escape HTML in a Rails 3.1 controller method?

Viewed 8684

h / html_escape don’t work within a controller method.

I know, it’s for views. (Or was — haven’t done much Rails since v2.3). But I’m just building an eensy-weensy string and want to use this method in my controller.

So how can I escape HTML from within a controller method?

1 Answers
Related