Rails helper, show word not date.

Posted by dannymcc on Stack Overflow See other posts from Stack Overflow or by dannymcc
Published on 2010-06-13T15:46:53Z Indexed on 2010/06/13 15:52 UTC
Read the original article Hit count: 295

Filed under:
|
|
|

Hi Everyone,

A follow on from this questions:

http://stackoverflow.com/questions/3032598/rails-created-at-on-display-if-today

Is it possible to output the word TODAY rather than the date when using the following helper?

def created_today k
   k.created_at if k.created_at.to_date == Date.today
end

<%=h created_today(k) %>

Thanks,

Danny

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about datetime