##// END OF EJS Templates
Moves flash messages rendering to a helper method....
Jean-Philippe Lang -
r2221:d25b6d46863a
parent child
Show More
@@ -148,6 +148,15 module ApplicationHelper
148 content
148 content
149 end
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 # 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)
153 truncate(string, *args).gsub(%r{[\r\n]+}m, ' ')
162 truncate(string, *args).gsub(%r{[\r\n]+}m, ' ')
@@ -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