Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
589 views
in Technique[技术] by (71.8m points)

rails: prevent flash message from showing twice

What's the correct way to set a flash message for the current view but not show it for the next request. In other words usually you set the flash message and redirect and the flash message gets shown on the redirect. I don't want to redirect and so I need to make sure the flash message doesn't get shown twice.

question from:https://stackoverflow.com/questions/11115268/rails-prevent-flash-message-from-showing-twice

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
flash.now[:notice] = 'message'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...