instance method discard

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

discard(k = nil)

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

Parameters

k opt = nil
Source
# File actionpack/lib/action_controller/flash.rb, line 107
      def discard(k = nil)
        use(k)
      end

Defined in actionpack/lib/action_controller/flash.rb line 107 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Flash::FlashHash

Type at least 2 characters to search.

↑↓ navigate · open · esc close