From 4c7dcb5dbf2950c39e2caa99e33d4807a0a327aa Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Sat, 11 Nov 2006 18:29:11 +0000 Subject: Remove JavaScriptLiteral in favor of ActiveSupport::JSON::Variable. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/prototype_helper.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'actionpack/lib/action_view') 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 #to_json 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) -- cgit v1.2.3