Forum: Ruby on Rails helper caching issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2009-03-26 18:37
(Received via mailing list)
I have a helper:

def pretty_datetime( dt )
  dt.strftime( "%b %d, %Y %I:%m%p" )
end


and I have a partial that uses the helper like this:

<%= pretty_datetime alert.updated_at %>


The problem is when I update the record the previous updated_at value
is still being displayed.


When I don't use the helper I see the updated_at value change every
time.

<%= alert.updated_at %>


When I put the helper call back again, the partial again shows me the
previous updated_at value, even after multiple updates and me taking
it away and putting it back multiple times.  Even if I restart the
server I'm still seeing the old updated_at values from when the record
was first created.  I see the values changing in the database when I
update the record so I know the problem isn't there.


So why is the output of my helper (or partial) being cached?

This is in development mode, Rails 2.3.2.


--
Greg Donald
http://destiney.com/
This topic is locked and can not be replied to.