time_ago_in_words
Description
time_ago_in_words(from_time, include_seconds = false)Like distance_of_time_in_words, but where to_time is fixed to Time.now.
Examples:
- You are member since <%= time_ago_in_words(current_user.created_at, include_seconds = false) %>
User Contributed Notes add
- You are member since <%= time_ago_in_words(current_user.created_at, include_seconds = false) %>
To use in a controller or model by iratik
>> include ActionView::Helpers::DateHelper => Object >> time_ago_in_words(Time.now) => "less than a minute" >>