Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge [5487] from trunk.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 9eaad14e8ef35b5ea245596e3c479bbd6f9e35a5 1 parent 9f8c805
@sstephenson sstephenson authored
View
2  actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Remove JavaScriptLiteral in favor of ActiveSupport::JSON::Variable. [Sam Stephenson]
+
* assert_response supports symbolic status codes. #6569 [Kevin Clark]
assert_response :ok
assert_response :not_found
View
9 actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -391,7 +391,7 @@ def [](id)
# 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 @@ def build_callbacks(options)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.