From 30a0ebb3eb9fd4c8e4401bcaa4887eb1ce95defa Mon Sep 17 00:00:00 2001 From: Sean Huber Date: Thu, 29 May 2008 10:49:38 -0700 Subject: Add RJS#page.reload. [#277 state:resolved] Signed-off-by: Pratik Naik --- actionpack/lib/action_view/helpers/prototype_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/lib/action_view') 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; -- cgit v1.2.3