Merge pull request #3578 from amatsuda/remove_j_alias_for_json_escape

Remove j alias for ERB::Util.json_escape
This commit is contained in:
Rafael Mendonça França 2012-08-21 14:18:38 -07:00
commit d65a15dca6
1 changed files with 0 additions and 7 deletions

View File

@ -60,18 +60,11 @@ class ERB
# 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(JSON_ESCAPE_REGEXP) { |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