I have a controller:
class StatsController < ApplicationController require 'time' def index @started = "Thu Feb 04 16:12:09 UTC 2010" @finished = "Thu Feb 04 16:13:44 UTC 2010" @duration_time = stats_duration(@started, @finished) end private def stats_duration(started, finished) time_taken = distance_of_time_in_words(Time.parse(started), Time.parse(finished)) time_taken end end
It takes time to start and end and calculates the duration between times.
When I run this, I get the following error:
private method `gsub! 'Called Tu Feb 04 16:12:09 UTC 2010: Time
Why is this happening?
ruby ruby-on-rails
Railson
source share