Thursday, March 22, 2012

Raw method was moved to OutputSafetyHelper in Rails 3.1 or later

When I upgraded from Rails 3.0 to Rails 3.1, the code below would not work because RawOutputHelper was removed.

include ActionView::Helpers::RawOutputHelper
raw %(#{html_tag})

So I had to change like this.

include ActionView::Helpers::OutputSafetyHelper
raw %(#{html_tag})

Needless to say, using raw method is not a good practice, I know.


I took an example from here before.