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:

  1. Thanks! I put it in my model, of all places.

    ReplyDelete
    Replies
    1. You are welcome! I am glad to hear that.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete