Commit d25b6d46 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Moves flash messages rendering to a helper method.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2223 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a66b1e77
......@@ -147,6 +147,15 @@ module ApplicationHelper
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)
......
......@@ -50,8 +50,7 @@
</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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment