Hi. Is there any way, that i can use a application_helper inside a controller helper ?
on 2007-01-23 06:43
on 2007-01-23 13:50
http://api.rubyonrails.org/classes/ActionControlle... On Jan 23, 6:43 am, Emil Kampp <rails-mailing-l...@andreas-s.net>
on 2007-01-25 02:41
Hi, I am subtracting 2 times which gives me the time difference in seconds as a float. How to I convert something like 3.815824 into 0:03 minutes? Thanks in advance! Cheers, Chris.
on 2007-01-25 04:16
Hi Chris, > How to I convert something like 3.815824 > into 0:03 minutes? There's nothing I know of 'in the can' for that level of granularity, but take a look at the source for distance_of_time_in_words helper (at api.rubyonrails.org). That should put you on the right track. hth, Bill
on 2007-01-25 05:28
On Jan 24, 8:40 pm, Chris H <c...@etechdata.com.au> wrote: > Chris. require 'rubygems' require 'ruby-units' a = time1 b = time2 c = (time1 -time2).unit('min') c.to_s('%H:%M") #=> '00:03' This works well if you need to do math on the units, or if you have to deal with a wide variety of units. _Kevin
on 2007-01-25 14:00
Hi Kevin, _Kevin wrote: > require 'ruby-units' > > > a = time1 > b = time2 > c = (time1 -time2).unit('min') > c.to_s('%H:%M") #=> '00:03' That's cool. Where is ruby-units documented? Thanks, Bill