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?
|
2012-09-14 23:17:45 +02:00
|
|
|
html << "<div class=\"flash-error\">\n"
|
2012-06-30 18:18:36 +02:00
|
|
|
object.errors.full_messages.each do |error|
|
|
|
|
html << error << "<br>"
|
|
|
|
end
|
2012-09-14 23:17:45 +02:00
|
|
|
html << "</div>\n"
|
2012-06-30 18:18:36 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
raw(html)
|
|
|
|
end
|
2013-02-22 18:22:39 +01:00
|
|
|
|
|
|
|
def time_ago_in_words_label(*args)
|
|
|
|
label_tag(nil, time_ago_in_words(*args),
|
|
|
|
:title => args.first.strftime("%F %T %z"))
|
|
|
|
end
|
2014-08-04 04:44:10 +02:00
|
|
|
|
|
|
|
def main_root_url
|
|
|
|
Rails.application.routes.url_helpers.root_url
|
|
|
|
end
|
2012-06-17 03:15:46 +02:00
|
|
|
end
|