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 +开发者_如何学Python0300:Time
I think the app can't convert the time correctly . How can i repair this problem ?
You have got wrong syntax
<%= time_ago_in_words(post.created_at) %>
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论