我distance_of_time_in_words
在 created_at 属性上使用 rails 4 但它不起作用
在我看来:
<% @posts.each do |post| %>
....
<td><%= distance_of_time_in_words(post.created_at, post.created_at + 30.days) %></td>
它总是显示:
about 1 month
如果我使用 time_ago_in_words 它有效
我distance_of_time_in_words
在 created_at 属性上使用 rails 4 但它不起作用
在我看来:
<% @posts.each do |post| %>
....
<td><%= distance_of_time_in_words(post.created_at, post.created_at + 30.days) %></td>
它总是显示:
about 1 month
如果我使用 time_ago_in_words 它有效