BACKTRACE

(condense)

Back to Posts List

GET

relative_time_helper plugin

most of us are using rails’s built in time_ago_in_words, Rick Olsan wrote a much better plugin to extend that use and gives much better results.

  1. <%= relative_time(Time.now) %>  
  2. # today  
  3. <%= relative_time(1.day.ago) %>  
  4. # yesterday  
  5. <%= relative_time(1.day.from_now) %>  
  6. # tomorrow  
  7. <%= relative_time_span([Time.now, 5.days.from_now]) %>  
  8. # May 17th - 22nd  


To install it just snap it out of:

  1. script/plugin install http://ar-code.svn.engineyard.com/plugins/relative_time_helpers  

POST

blog comments powered by Disqus

I Don't have cookies.

ELAD ENV

Variable Value
LINKEDIN
TWITTER
FACEBOOK
GITHUB
WWR
IRC
{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]}
SKYPE
eladmeidar

You're seeing this error because I think it is funny.