aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2006-11-11 18:29:11 +0000
committerSam Stephenson <sam@37signals.com>2006-11-11 18:29:11 +0000
commit4c7dcb5dbf2950c39e2caa99e33d4807a0a327aa (patch)
tree52f732e6c259eef07301be5ed5158896b050edb3
parent2516063f61cedf4eee36036a0b4bc9fb8c443ba1 (diff)
downloadrails-4c7dcb5dbf2950c39e2caa99e33d4807a0a327aa.tar.gz
rails-4c7dcb5dbf2950c39e2caa99e33d4807a0a327aa.tar.bz2
rails-4c7dcb5dbf2950c39e2caa99e33d4807a0a327aa.zip
Remove JavaScriptLiteral in favor of ActiveSupport::JSON::Variable.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb9
2 files changed, 3 insertions, 8 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 2d3974f29d..e1dae7e939 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Remove JavaScriptLiteral in favor of ActiveSupport::JSON::Variable. [Sam Stephenson]
+
* Sync ActionController::StatusCodes::STATUS_CODES with http://www.iana.org/assignments/http-status-codes. #6586 [dkubb]
* Multipart form values may have a content type without being treated as uploaded files if they do not provide a filename. #6401 [Andreas Schwarz, Jeremy Kemper]
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 3c28173462..dab10a6b37 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -391,7 +391,7 @@ module ActionView
# Returns an object whose <tt>#to_json</tt> evaluates to +code+. Use this to pass a literal JavaScript
# expression as an argument to another JavaScriptGenerator method.
def literal(code)
- JavaScriptLiteral.new(code)
+ ActiveSupport::JSON::Variable.new(code.to_s)
end
# Returns a collection reference by finding it through a CSS +pattern+ in the DOM. This collection can then be
@@ -688,13 +688,6 @@ module ActionView
end
end
- # Bypasses string escaping so you can pass around raw JavaScript
- class JavaScriptLiteral < String #:nodoc:
- def to_json
- to_s
- end
- end
-
# Converts chained method calls on DOM proxy elements into JavaScript chains
class JavaScriptProxy < Builder::BlankSlate #:nodoc:
def initialize(generator, root = nil)