File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
actionpack/lib/action_dispatch/middleware Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ def key?(name)
177
177
@flashes . key? name . to_s
178
178
end
179
179
180
+ # Immediately deletes the single flash entry. Use this method when you
181
+ # want remove the message within the current action. See also #discard.
180
182
def delete ( key )
181
183
key = key . to_s
182
184
@discard . delete key
@@ -245,6 +247,9 @@ def keep(k = nil)
245
247
#
246
248
# flash.discard # discard the entire flash at the end of the current action
247
249
# flash.discard(:warning) # discard only the "warning" entry at the end of the current action
250
+ #
251
+ # Use this method when you want to display the message in the current
252
+ # action but not in the next one. See also #delete.
248
253
def discard ( k = nil )
249
254
k = k . to_s if k
250
255
@discard . merge Array ( k || keys )
You can’t perform that action at this time.
0 commit comments