title: respond_with & Flash Notice
body: <p>I have the following in one of my controllers:</p>
  
  <pre><code>def create
  
    photo.user = current_user if current_user
    flash[:notice] = "The photos was saved" if photo.save
    respond_with photo, :location =&gt; photo_path(photo)
  
  end
  </code></pre>
  
  <p>This code works with one exception. If I access this action w/ some kind of AJAX, and then visit another page, the flash notice will get displayed. How can I only display the flash notice when responding with :html? I thought maybe you could pass a :notice => "my flash" to <code>respond_with</code> but no luck.</p>