Skip to content

Commit

Permalink
added convenience methods #notice and #alert to flash.now
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
Martin authored and josevalim committed May 15, 2010
1 parent cdf7001 commit e807476
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions actionpack/lib/action_dispatch/middleware/flash.rb
Expand Up @@ -49,6 +49,16 @@ def []=(k, v)
def [](k)
@flash[k]
end

# Convenience accessor for flash.now[:alert]=
def alert=(message)
self[:alert] = message
end

# Convenience accessor for flash.now[:notice]=
def notice=(message)
self[:notice] = message
end
end

class FlashHash < Hash
Expand Down

0 comments on commit e807476

Please sign in to comment.