2012-06-17 03:15:46 +02:00
|
|
|
module ApplicationHelper
|
2012-06-30 18:18:36 +02:00
|
|
|
def errors_for(object, message=nil)
|
|
|
|
html = ""
|
|
|
|
unless object.errors.blank?
|
|
|
|
html << "<p><div class=\"flash-error\">\n"
|
|
|
|
object.errors.full_messages.each do |error|
|
|
|
|
html << error << "<br>"
|
|
|
|
end
|
|
|
|
html << "</div></p>\n"
|
|
|
|
end
|
|
|
|
|
|
|
|
raw(html)
|
|
|
|
end
|
2012-06-17 03:15:46 +02:00
|
|
|
end
|