title: rails 3 - stay on page after ajax form submit but show "flash"
body: <p>I'm using Rails 3 and I have an ajax form (i.e. :remote => true) that hit's a "insert" action on my controller.</p>
  
  <p>What I want is for the user to stay on the index page but be able to display flash messages set by the "insert" action in the controller.</p>
  
  <p>Currently my "insert" action does something like:</p>
  
  <pre><code>def insert
    begin
      # perform insert of stuff
      flash[:success] = "Successfully..."
    rescue
      flash[:error] = "failed ..."
    end
    render :nothing =&gt; true
  end
  </code></pre>
  
  <p>This allows the form (on index.html.erb) to be submitted and keeps the user on that page but no flash messages show up. How can I get the flash messages to appear? (guessing it has to do with the render :nothing stuff, but without that I get "missing template" errors in the server log).</p>