aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/output_safety.rb
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2011-11-09 14:34:10 +0900
committerAkira Matsuda <ronnie@dio.jp>2011-11-09 14:35:15 +0900
commited2eac83125a2aa81cc83f946cc5ffff742f8ddb (patch)
tree6cc2063ef3b55626514743eda074094480f438e8 /activesupport/lib/active_support/core_ext/string/output_safety.rb
parent6e87281b5f9f6f7abf0ef93448c63396419f1920 (diff)
downloadrails-ed2eac83125a2aa81cc83f946cc5ffff742f8ddb.tar.gz
rails-ed2eac83125a2aa81cc83f946cc5ffff742f8ddb.tar.bz2
rails-ed2eac83125a2aa81cc83f946cc5ffff742f8ddb.zip
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 5d7f74bb65..c90f58dffa 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -45,18 +45,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(/[&"><]/) { |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