discard(k = nil) public

Marks the entire flash or a single flash entry to be discarded by the end of the current action:

flash.discard              # discard the entire flash at the end of the current action
flash.discard(:warning)    # discard only the "warning" entry at the end of the current action

Use this method when you want to display the message in the current action but not in the next one. See also #delete.

Show source
Register or log in to add new notes.