 <p>The web browser is expecting some javascript to be executed after the ajax has been called. Your code should work when javascript is disabled in the browser.</p> <p>In the add_new_message method you should add:</p> <pre><code>respond_to do |format| format.html { redirect_to(:action =&gt; 'index') } format.js end </code></pre> <p>Then some javascript in add_new_message.js.erb will be executed, so to redirect to the index, the code in add_new_message.js.erb should look like:</p> <pre><code>window.location = '&lt;%= forums_path %&gt;'; //or whatever other path </code></pre> <p>Although both the HTML and javascript do the same thing. Why is the ajax needed in the first place?</p>