Hey guys, I am trying to run a proccess by submitting an AJAX form:
<% form_remote_tag :url => {:controller => 'sender', :action => 'send'} do %>
<input id="messsageinput" type="text" size="44" name="command"/>
<%= submit_tag('Send', :id => 'button') %>
<% end %>
Then, the 'send' action creates a new BackgrounDRB job and does some render :update magic:
MiddleMan.worker(:transmit_worker).async_transmit(:arg => {:linkes => linkes, :command => params[:command], :userid => current_user.id}, :job_key => current_user.id)
render :update do |page|
page.insert_html :bottom, 'ajaxholder', :partial => 'transmit'
page[:cominput].clear
end
the part where I'm stuck is I am trying to somehow have the page check a 'getstatus' action that checks the progress of the job and renders appropriately and then stop checking when the job is reported done. Any suggestions please?