@@ -148,6 +148,15 module ApplicationHelper | |||
|
148 | 148 | content |
|
149 | 149 | end |
|
150 | 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 | |
|
159 | ||
|
151 | 160 | # Truncates and returns the string as a single line |
|
152 | 161 | def truncate_single_line(string, *args) |
|
153 | 162 | truncate(string, *args).gsub(%r{[\r\n]+}m, ' ') |
@@ -50,8 +50,7 | |||
|
50 | 50 | </div> |
|
51 | 51 | |
|
52 | 52 | <div id="content"> |
|
53 | <%= content_tag('div', flash[:error], :class => 'flash error') if flash[:error] %> | |
|
54 | <%= content_tag('div', flash[:notice], :class => 'flash notice') if flash[:notice] %> | |
|
53 | <%= render_flash_messages %> | |
|
55 | 54 | <%= yield %> |
|
56 | 55 | </div> |
|
57 | 56 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now