Skip to content

Commit 5dcc193

Browse files
committed
Merge pull request #62 from DonutWorks/bug/show-message-at-auth-failure
fixed a problem upon not showing flash message (#43)
2 parents b07e03e + 0a4539d commit 5dcc193

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

app/helpers/application_helper.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
module ApplicationHelper
2-
end
2+
def flash_class(level)
3+
case level.intern
4+
when :notice then "alert alert-info"
5+
when :success then "alert alert-success"
6+
when :error then "alert alert-danger"
7+
when :alert then "alert alert-danger"
8+
end
9+
end
10+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<% flash.each do |type, message| %>
2+
<div class="alert <%= flash_class(type) %> alert-dismissable fade in">
3+
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
4+
<%= message %>
5+
</div>
6+
<% end %>

app/views/layouts/application.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
</div>
6363

6464
<div class="container">
65+
<%= render 'layouts/messages' %>
6566
<%= yield %>
6667
</div>
6768

0 commit comments

Comments
 (0)