Show length of event types in new proposal drop down

This commit is contained in:
differentreality 2013-09-01 18:19:25 +03:00
parent 2314d943e1
commit 9125bafe4a
3 changed files with 18 additions and 1 deletions

View file

@ -15,6 +15,21 @@ module ApplicationHelper
end
end
def show_time(length)
h = length / 60
min = length - h * 60
if h != 0
if min != 0
"#{h} h #{min} min"
else
"#{h} h"
end
else
"#{min} min"
end
end
def add_association_link(association_name, form_builder, div_class, html_options = {})
link_to_add_association "Add " + association_name.to_s.singularize, form_builder, div_class, html_options.merge(:class => "assoc btn btn-success")
end