title: How to perform an action within a page in Rails without rendering a new page
body: <p>In my rails app I'm trying to add a contact user popup box which delivers an email message to a user.</p>
  
  <p>I have the javascript in place to display the popup form, which is itself a partial. </p>
  
  <p>When the user clicks submit on the contact form it calls a controller action which delivers the mail. After submitting the message I want to stay on the same page, but hide the popup box. My problem is that I can't get the controller action which delivers the mail not to render its own view. I tried </p>
  
  <pre><code>render nothing: true
  </code></pre>
  
  <p>But that simply renders a blank page.</p>
  
  <p>My form is set up as follows</p>
  
  <pre><code>= form_tag({:controller =&gt; 'users', :action =&gt; 'contact_user'}, :method =&gt; 'put') do 
  </code></pre>
  
  <p>And in my routes config I have</p>
  
  <pre><code>resources :users
    collection do
       put 'contact_user'
    end
  </code></pre>