Report abuse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
map.resources :documents, :member => { :ping => :get }
def ping
begin
@document = Document.find(params[:id])
rescue
logger.error("could not find Document ID #{params[:id]}")
flash[:notice] = "Could not find ID #{params[:id]}"
redirect_to :action => :index
else
@percent = @document.progress
@document_id = @document.id
redirect_to :action => :index unless request.xhr?
end
end
<%= periodically_call_remote(:url => (ping_document_path(@document), :method => :get ),
:frequency => 4,
:condition => "$('#{@document.id}indicator').innerHTML != 'Finished'",
:complete => "progressbar#{@document.id}") %>
<% end %>
map.resources :vms_documents, :active_scaffold => true, :member => { :import_vms => :put }, :member => { :ping => :post }
<%= periodically_call_remote(:url => ping_document_path(@document),
|