Created
October 22, 2014 01:25
-
-
Save cybersamx/4039f46f32c95b5116ee to your computer and use it in GitHub Desktop.
Rails notice vs flash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The mechanism for embedding a notification in a Rails controller is different for render and redirect. | |
def ping1 | |
flash[:error] = 'Warning...' | |
render action: 'pong' | |
end | |
def ping2 | |
redirect_to pong_path, notice: 'Warning...' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment