@@ -147,6 +147,15 module ApplicationHelper | |||||
147 | end |
|
147 | end | |
148 | content |
|
148 | content | |
149 | end |
|
149 | end | |
|
150 | ||||
|
151 | # Renders flash messages | |||
|
152 | def render_flash_messages | |||
|
153 | s = '' | |||
|
154 | flash.each do |k,v| | |||
|
155 | s << content_tag('div', v, :class => "flash #{k}") | |||
|
156 | end | |||
|
157 | s | |||
|
158 | end | |||
150 |
|
159 | |||
151 | # Truncates and returns the string as a single line |
|
160 | # Truncates and returns the string as a single line | |
152 | def truncate_single_line(string, *args) |
|
161 | def truncate_single_line(string, *args) |
@@ -50,8 +50,7 | |||||
50 | </div> |
|
50 | </div> | |
51 |
|
51 | |||
52 | <div id="content"> |
|
52 | <div id="content"> | |
53 | <%= content_tag('div', flash[:error], :class => 'flash error') if flash[:error] %> |
|
53 | <%= render_flash_messages %> | |
54 | <%= content_tag('div', flash[:notice], :class => 'flash notice') if flash[:notice] %> |
|
|||
55 | <%= yield %> |
|
54 | <%= yield %> | |
56 | </div> |
|
55 | </div> | |
57 | </div> |
|
56 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now