aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/output_safety.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-21 14:18:38 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-21 14:18:38 -0700
commitd65a15dca6cd26ed1e40ec6313cf5ba740ba41e7 (patch)
tree7dc69264d37a99b59c5950f7ea4e909fd797b74b /activesupport/lib/active_support/core_ext/string/output_safety.rb
parent973b278598d0652c5563a164a268d384f4eac537 (diff)
parented2eac83125a2aa81cc83f946cc5ffff742f8ddb (diff)
downloadrails-d65a15dca6cd26ed1e40ec6313cf5ba740ba41e7.tar.gz
rails-d65a15dca6cd26ed1e40ec6313cf5ba740ba41e7.tar.bz2
rails-d65a15dca6cd26ed1e40ec6313cf5ba740ba41e7.zip
Merge pull request #3578 from amatsuda/remove_j_alias_for_json_escape
Remove j alias for ERB::Util.json_escape
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/output_safety.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb7
1 files changed, 0 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index c17d695967..dad4b29d46 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -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