aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-08-23 00:24:22 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-08-23 00:24:22 +0530
commit6431753851c42346fa49b10d5371d77696cbcf99 (patch)
tree7d4326707a79d9ddfe5c83e937808c21b0a9ffc5 /actionpack/lib/action_view/helpers
parent8fbfeb1ef7bef5df912aede129b1bee57e9adf53 (diff)
downloadrails-6431753851c42346fa49b10d5371d77696cbcf99.tar.gz
rails-6431753851c42346fa49b10d5371d77696cbcf99.tar.bz2
rails-6431753851c42346fa49b10d5371d77696cbcf99.zip
copy edit the time_ago_in_words helper docs
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 0403aac596..096ad12892 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -139,11 +139,8 @@ module ActionView
# Like <tt>distance_of_time_in_words</tt>, but where <tt>to_time</tt> is fixed to <tt>Time.now</tt>.
#
- # The <tt>from_time</tt> argument must be of type <tt>Time</tt> rather than type <tt>Numeric</tt>. For example,
- # to get the <tt>time_ago_in_words</tt> for 30 minutes you would use <tt>30.minutes.ago</tt> as the argument
- # rather than just <tt>30.minutes</tt>.
- #
# time_ago_in_words(3.minutes.from_now) # => 3 minutes
+ # time_ago_in_words(3.minutes.ago) # => 3 minutes
# time_ago_in_words(Time.now - 15.hours) # => about 15 hours
# time_ago_in_words(Time.now) # => less than a minute
# time_ago_in_words(Time.now, :include_seconds => true) # => less than 5 seconds
@@ -153,6 +150,9 @@ module ActionView
#
# from_time = (3.days + 14.minutes + 25.seconds).ago
# time_ago_in_words(from_time) # => 3 days
+ #
+ # Note that you cannot pass a <tt>Numeric</tt> value to <tt>time_ago_in_words</tt>.
+ #
def time_ago_in_words(from_time, include_seconds_or_options = {})
distance_of_time_in_words(from_time, Time.now, include_seconds_or_options)
end