<%= javascript_include_tag "prototype" %>
<h1>Test periodically_call_remote</h1>
<div id='show_date_time_id' style="background-color: #eee"></div>
<%= periodically_call_remote(:update => 'show_date_time_id',:url =>
{ :action => :show_date_time },
:frequency => 1 )%>
<h1>Test periodically_call_remote</h1>
<div id='show_date_time_id' style="background-color: #eee"></div>
<%= periodically_call_remote(:update => 'show_date_time_id',:url =>
{ :action => :show_date_time },
:frequency => 1 )%>
Step 2: ajax_controller.rb
def show_date_time
render :text=>"Now : #{DateTime.now.to_s}"
end
render :text=>"Now : #{DateTime.now.to_s}"
end
If you find this useful, would you like to buy me a drink? No matter more or less, it will be an encouragement for me to go further. Thanks in advance!! =)