aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorSean Huber <sean.huber@cox.net>2008-05-29 10:49:38 -0700
committerPratik Naik <pratiknaik@gmail.com>2008-06-04 13:32:53 +0100
commit30a0ebb3eb9fd4c8e4401bcaa4887eb1ce95defa (patch)
tree2d0a36512d6c956b7e64e0e70c78c4da2181917d /actionpack/lib
parent82e96eb294ae21528c3e05e91c05c7ee5222afbd (diff)
downloadrails-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')
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb10
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;