Skip to content

Commit

Permalink
Merge [5487] from trunk.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
sstephenson committed Nov 12, 2006
1 parent 9f8c805 commit 9eaad14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions 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
Expand Down
9 changes: 1 addition & 8 deletions actionpack/lib/action_view/helpers/prototype_helper.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9eaad14

Please sign in to comment.