Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目前,我在 Rails 中发布内容后,时间格式为
<time><%= post.created_at.to_formatted_s(:day_month_year) %></time>
我怎样才能让它说“大约 6 分钟前”?
<time><%= time_ago_in_words(post.created_at) %> ago</time>