I’m using distance_of_time_in_words to generate friendly text but not
sure it’s the right method to say something was entered “today”.
Is there an option or other process to use to achieve the text reading
“today” rather than about xx hours ago? I’marst ting to think I need to
create a new helper method or edit the configs or something.
I’m using distance_of_time_in_words to generate friendly text but not
sure it’s the right method to say something was entered “today”.
Is there an option or other process to use to achieve the text reading
“today” rather than about xx hours ago? I’marst ting to think I need to
create a new helper method or edit the configs or something.
module ApplicationHelper
def today_or_time_ago_in_words(time)
(time.to_date == Time.now.to_date ? ‘today’ :
time_ago_in_words(time))
end
end