Module: ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#periodically_call_remote(options = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/application_helper.rb', line 3

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