Alex
Alex

Reputation: 11147

problem converting time

i have a post and i need to display how long ago it was posted.

When i do this

 <%= time_ago_in_words(Time.now - post.created_at) %>

i get the following error

undefined method `abs' for 2011-04-17 17:16:11 +0300:Time

I think the app can't convert the time correctly . How can i repair this problem ?

Upvotes: 0

Views: 450

Answers (1)

fl00r
fl00r

Reputation: 83680

You have got wrong syntax

<%= time_ago_in_words(post.created_at) %>

Upvotes: 3

Related Questions