@seconds_from_model_creation = (Time.now.to_i - Time.at
(@model.created_at).to_i)
@days_from_creation = @seconds_from_model_creation / (60*60*24)
...

On May 12, 6:48 pm, Charanya Nagarajan <rails-mailing-l...@andreas-
s.net> wrote:
> Hi
>
> I want to display the created_at field of my model in the format n days
> ago n hours ago
>
> Please help me in this
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to