提交 d65a15dc 编写于 作者: R Rafael Mendonça França

Merge pull request #3578 from amatsuda/remove_j_alias_for_json_escape

Remove j alias for ERB::Util.json_escape
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册