Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Fixed flash_class helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
nning committed Jul 24, 2014
1 parent f38624a commit 8dce1bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def domains

# Convert flash message type to bootstrap class.
def flash_class(type)
({ notice: :info, alert: :warning, error: :danger }[type] or type).to_s
({notice: :info, alert: :warning, error: :danger}[type.to_sym] || type).to_s
end

# Link to last visited page.
Expand Down
10 changes: 7 additions & 3 deletions app/views/shared/_flash_messages.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
- flash.each do |type, message|
%div{class: "alert alert-#{flash_class(type)}"}
= link_to '×', '#', class: 'close', :'data-dismiss' => 'alert'
%p= message
%div.alert.alert-dismissable{class: "alert-#{flash_class(type)}"}
= link_to '#', class: 'close', :'data-dismiss' => 'alert' do
%span{:'aria-hidden' => 'true'} ×
%span.sr-only Close
%p
%strong= flash_class(type).capitalize + ':'
= message

0 comments on commit 8dce1bd

Please sign in to comment.