end
content
end
+
+ # Renders flash messages
+ def render_flash_messages
+ s = ''
+ flash.each do |k,v|
+ s << content_tag('div', v, :class => "flash #{k}")
+ end
+ s
+ end
# Truncates and returns the string as a single line
def truncate_single_line(string, *args)
</div>
<div id="content">
- <%= content_tag('div', flash[:error], :class => 'flash error') if flash[:error] %>
- <%= content_tag('div', flash[:notice], :class => 'flash notice') if flash[:notice] %>
+ <%= render_flash_messages %>
<%= yield %>
</div>
</div>