Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3578 from amatsuda/remove_j_alias_for_json_escape

Remove j alias for ERB::Util.json_escape
  • Loading branch information...
commit d65a15dca6cd26ed1e40ec6313cf5ba740ba41e7 2 parents 973b278 + ed2eac8
@rafaelfranca rafaelfranca authored
View
7 activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -60,18 +60,11 @@ def html_escape_once(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(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
Please sign in to comment.
Something went wrong with that request. Please try again.