diff options
author | Sean Huber <sean.huber@cox.net> | 2008-05-29 10:49:38 -0700 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-06-04 13:32:53 +0100 |
commit | 30a0ebb3eb9fd4c8e4401bcaa4887eb1ce95defa (patch) | |
tree | 2d0a36512d6c956b7e64e0e70c78c4da2181917d /actionpack/lib/action_view/helpers | |
parent | 82e96eb294ae21528c3e05e91c05c7ee5222afbd (diff) | |
download | rails-30a0ebb3eb9fd4c8e4401bcaa4887eb1ce95defa.tar.gz rails-30a0ebb3eb9fd4c8e4401bcaa4887eb1ce95defa.tar.bz2 rails-30a0ebb3eb9fd4c8e4401bcaa4887eb1ce95defa.zip |
Add RJS#page.reload. [#277 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 602832e470..5a1012954e 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -868,6 +868,16 @@ module ActionView record "window.location.href = #{url.inspect}" end + # Reloads the browser's current +location+ using JavaScript + # + # Examples: + # + # # Generates: window.location.reload(); + # page.reload + def reload + record 'window.location.reload()' + end + # Calls the JavaScript +function+, optionally with the given +arguments+. # # If a block is given, the block will be passed to a new JavaScriptGenerator; |