Rails 3 - time_ago_in_words says “ABOUT 2 hours ago”

后端 未结 3 1846
忘掉有多难
忘掉有多难 2020-12-23 20:47

Code:

<%=\"#{time_ago_in_words(comment.created_at)} ago \"%>

What i\'d like is for it not to have \"ABOUT\" in front of the 2 hours a

3条回答
  •  不思量自难忘°
    2020-12-23 21:37

    You can change this via your I18n locale file. In config/locales/en.yml...

    "en":
      datetime:
        distance_in_words:
          about_x_hours:
            # The defaults are "about 1 hour" and "about %{count} hours"
            one: "1 hour"
            other: "%{count} hours"
    

    See the default locale file in actionpack for a complete reference.

提交回复
热议问题