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.


NOTE:

I took an example from here before.

http://www.rabbitcreative.com/2010/09/20/rails-3-still-fucking-up-field_with_errors/

3 comments: