diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-04-02 12:48:59 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-04-02 12:48:59 +0000 |
commit | 1e087fd3fd0d6c0b839ab6c15982a996a5d4d531 (patch) | |
tree | ea3fac18189a3d716085fa6461dcaf886a48372e /actionpack/lib/action_view/helpers/prototype_helper.rb | |
parent | 6a36d96aa2171a00bc63c0696969f5782dd5c5a4 (diff) | |
download | rails-1e087fd3fd0d6c0b839ab6c15982a996a5d4d531.tar.gz rails-1e087fd3fd0d6c0b839ab6c15982a996a5d4d531.tar.bz2 rails-1e087fd3fd0d6c0b839ab6c15982a996a5d4d531.zip |
Ensure RJS redirect_to doesn't html-escapes string argument. Closes #8546
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/prototype_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 725e968ddd..50feac5a0f 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -843,7 +843,8 @@ module ActionView # # Generates: window.location.href = "/account/signup"; # page.redirect_to(:controller => 'account', :action => 'signup') def redirect_to(location) - assign 'window.location.href', @context.url_for(location) + url = location.is_a?(String) ? location : @context.url_for(location) + record "window.location.href = #{url.inspect}" end # Calls the JavaScript +function+, optionally with the given +arguments+. |