aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-30 15:01:02 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-30 15:01:02 -0600
commit95f317b0204d63810b837eae48667d9ed311f7dd (patch)
tree301af62fc9db53469410f9128007031cb7e22cfc /actionpack/lib
parent61c9b1648703c29133c3ea2ec083e275d95edbec (diff)
downloadrails-95f317b0204d63810b837eae48667d9ed311f7dd.tar.gz
rails-95f317b0204d63810b837eae48667d9ed311f7dd.tar.bz2
rails-95f317b0204d63810b837eae48667d9ed311f7dd.zip
Move periodically_call_remote into prototype_legacy_helper plugin
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 92f4ca838f..0ec7b48c25 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -39,10 +39,6 @@ module ActionView
# <div><%= submit_tag 'Recalculate Shipping' %></div>
# <% end -%>
#
- # ...periodically...
- #
- # periodically_call_remote(:url => 'update', :frequency => '5', :update => 'ticker')
- #
# As you can see, there are numerous ways to use Prototype's Ajax functions (and actually more than
# are listed here); check out the documentation for each method to find out more about its usage and options.
#
@@ -255,37 +251,6 @@ module ActionView
button_to_function(name, remote_function(options), html_options)
end
- # Periodically calls the specified url (<tt>options[:url]</tt>) every
- # <tt>options[:frequency]</tt> seconds (default is 10). Usually used to
- # update a specified div (<tt>options[:update]</tt>) with the results
- # of the remote call. The options for specifying the target with <tt>:url</tt>
- # and defining callbacks is the same as link_to_remote.
- # Examples:
- # # Call get_averages and put its results in 'avg' every 10 seconds
- # # Generates:
- # # new PeriodicalExecuter(function() {new Ajax.Updater('avg', '/grades/get_averages',
- # # {asynchronous:true, evalScripts:true})}, 10)
- # periodically_call_remote(:url => { :action => 'get_averages' }, :update => 'avg')
- #
- # # Call invoice every 10 seconds with the id of the customer
- # # If it succeeds, update the invoice DIV; if it fails, update the error DIV
- # # Generates:
- # # new PeriodicalExecuter(function() {new Ajax.Updater({success:'invoice',failure:'error'},
- # # '/testing/invoice/16', {asynchronous:true, evalScripts:true})}, 10)
- # periodically_call_remote(:url => { :action => 'invoice', :id => customer.id },
- # :update => { :success => "invoice", :failure => "error" }
- #
- # # Call update every 20 seconds and update the new_block DIV
- # # Generates:
- # # new PeriodicalExecuter(function() {new Ajax.Updater('news_block', 'update', {asynchronous:true, evalScripts:true})}, 20)
- # periodically_call_remote(:url => 'update', :frequency => '20', :update => 'news_block')
- #
- def periodically_call_remote(options = {})
- frequency = options[:frequency] || 10 # every ten seconds by default
- code = "new PeriodicalExecuter(function() {#{remote_function(options)}}, #{frequency})"
- javascript_tag(code)
- end
-
# Returns a form tag that will submit using XMLHttpRequest in the
# background instead of the regular reloading POST arrangement. Even
# though it's using JavaScript to serialize the form elements, the form