Class: ActionView::Base
- Inherits:
-
Object
- Object
- ActionView::Base
- Defined in:
- lib/locomotive/rails/action_view.rb
Overview
Instance Method Summary collapse
- #json_escape(s) ⇒ Object (also: #j)
Instance Method Details
#json_escape(s) ⇒ Object Also known as: j
3 4 5 6 |
# File 'lib/locomotive/rails/action_view.rb', line 3 def json_escape(s) result = s.to_s.gsub('/', '\/') s.html_safe? ? result.html_safe : result end |