Formatting time calculation

i don't know that there is a specific rails method to do that. however, something like this should do the trick.

def hms(secs)   h, secs = secs.divmod(3600)   m, s = secs.divmod(60)   h = h.to_s.rjust(2, "0")   m = m.to_s.rjust(2, "0")   s = s.round.to_s.rjust(2, "0")   "#{h}:#{m}:#{s}" end

put that in your application_helper.rb file

<%= hms(@object.duration_in_secs) -%>