Method: ActionView::Helpers::OutputSafetyHelper#raw

Defined in:
actionview/lib/action_view/helpers/output_safety_helper.rb

#raw(stringish) ⇒ Object

This method outputs without escaping a string. Since escaping tags is now default, this can be used when you don’t want Rails to automatically escape tags. This is not recommended if the data is coming from the user’s input.

For example:

raw @user.name
# => 'Jimmy <alert>Tables</alert>'


18
19
20
# File 'actionview/lib/action_view/helpers/output_safety_helper.rb', line 18

def raw(stringish)
  stringish.to_s.html_safe
end