Brendon Gleeson
2006-Feb-01 08:42 UTC
[Rails] distance_of_time_in_words_to_now with "ago" suffix
I wanted the distance_of_time_in_words_to_now method to have '' ago'' suffixed to it when the date is in the past, I assumed this would be the default behaviour but apparently not. I know of a REALLY messy way that i could solve this with, but it''s so ugly I can''t be bothered Does anybody have an easy, elegant solution?
Francois Beausoleil
2006-Feb-01 14:15 UTC
[Rails] distance_of_time_in_words_to_now with "ago" suffix
Hi ! 2006/2/1, Brendon Gleeson <brendon@gleesonprop.co.za>:> I wanted the distance_of_time_in_words_to_now method to have '' ago'' > suffixed to it when the date is in the past, I assumed this would be the > default behaviour but apparently not. I know of a REALLY messy way that > i could solve this with, but it''s so ugly I can''t be bothered > > Does anybody have an easy, elegant solution?<p><%= distance_of_time_in_word_to_now(@created_at) %> ago</p> Isn''t that what you want ? Hope that helps ! -- Fran?ois Beausoleil http://blog.teksol.info/