method

discard

rails latest stable - Class: ActionController::Flash::FlashHash

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

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