 <p>For AJAX requests running through a controller action, you'd need to use <code>flash.now</code> so that the flash message will be available for the current request. So in your case, <code>flash.now[:notice] = "bar"</code>. </p>