diff options
Diffstat (limited to 'actionpack/lib/action_view')
-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+. |