Is it possible to show the flash message in rails only once? I mean, when I delete something the flash says "Deleted (undo)", and then if I click a click and then the browser's Back button the message开发者_如何学Python is still there.
You could use
flash.now
Here's a thumb-rule.
In your controller, use flash when you're redirecting and flash.now when rendering.
This is probably a generic browser caching problem. You can force your browser to reload a page while hitting the back button by setting some no-cache headers.
You could try this approach: (found after a quick google search, you might want to dig deeper)
http://blog.serendeputy.com/posts/how-to-prevent-browsers-from-caching-a-page-in-rails/
精彩评论