【发布时间】:2013-04-19 05:50:13
【问题描述】:
我收到了这种格式的日期和时间
2013-04-19 11:07:37 +0530
我想知道如何在 ruby 中以这种方式显示 XYZ hours ago。
谢谢
更新:我尝试了time_ago_in_words' and it gives me the errorundefined 方法time_ago_in_words'
【问题讨论】:
-
试试这个时间_ago_in_words(Time.now)
-
更新了问题。谢谢。
-
这是普通的红宝石还是在 Rails 视图中?
标签: ruby ruby-on-rails-3