Permalink
Browse files

Remove j alias for ERB::Util.json_escape

  • Loading branch information...
1 parent 6e87281 commit ed2eac83125a2aa81cc83f946cc5ffff742f8ddb @amatsuda amatsuda committed Nov 9, 2011
Showing with 0 additions and 7 deletions.
  1. +0 −7 activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -45,18 +45,11 @@ def html_escape(s)
# json_escape('{"name":"john","created_at":"2010-04-28T01:39:31Z","id":1}')
# # => {name:john,created_at:2010-04-28T01:39:31Z,id:1}
#
- # This method is also aliased as +j+, and available as a helper
- # in Rails templates:
- #
- # <%=j @person.to_json %>
- #
def json_escape(s)
result = s.to_s.gsub(/[&"><]/) { |special| JSON_ESCAPE[special] }
s.html_safe? ? result.html_safe : result
end
- alias j json_escape
- module_function :j
module_function :json_escape
end
end

0 comments on commit ed2eac8

Please sign in to comment.