Skip to content

Instantly share code, notes, and snippets.

@cybersamx
Created October 22, 2014 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cybersamx/4039f46f32c95b5116ee to your computer and use it in GitHub Desktop.
Save cybersamx/4039f46f32c95b5116ee to your computer and use it in GitHub Desktop.
Rails notice vs flash
# 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