Monitoring a server-side process on Rails application using AJAX XMLHttpRequest <p>I'm using the following in the web page but can't get a response from the server while it's processing</p> <pre><code>&lt;script type="text/javascript"&gt; &lt;!-- function updateProgress() { //alert('Hello'); new Ajax.Request('/fmfiles/progress_monitor', { parameters: 'authenticity_token=' + encodeURIComponent(AUTH_TOKEN), onSuccess: function(response) { alert(response.responseText); fillProgress('progressBar',response.responseText); } }); } //--&gt; &lt;/script&gt; &lt;% form_for( :fmfile, :url =&gt; '/fmfiles', :html =&gt; { :method =&gt; :post, :name =&gt; 'Form_Import', :enctype =&gt; 'multipart/form-data' } ) do |f| %&gt; ... &lt;%= f.file_field :document, :accept =&gt; 'text/xml', :name =&gt; 'fmfile_document' %&gt; &lt;%= submit_tag 'Import', :onClick =&gt; "setInterval('updateProgress()', 2000);" %&gt; </code></pre> <p>The 'create' method in fmfiles_controller.rb then happily processes the file and gets the right results (as per the submit button on the form). If I uncomment the '//alert('Hello')' line I get a dialog saying Hello every 2 seconds ... as expected.</p> <p>However, the server never logs any call to 'progress_monitor' method in 'files' not even a failed attempt.</p> <p>If I click the link</p> <pre><code>&lt;a href="#" onclick="updateProgress();"&gt;Run&lt;/a&gt; </code></pre> <p>it makes a call to the server, gets a response and displays the dialog, so I assume the routes and syntax and naming is all OK.</p> <p>I really don't know why this isn't working. Is it because 2 methods in the same controller are being called via URLs?</p> <p>I'm using Rails 2.1.0 in a development environment on OS X 10.5.5 and using Safari 3.1.2</p> <p>(N.B. This follows on from another <a href="http://stackoverflow.com/questions/120201/updating-server-side-progress-on-rails-application">question</a>, but I think it's sufficiently different to merit its own question.)</p>