Forum: Ruby on Rails helper caching issue

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Greg D. (Guest)
on 2009-03-26 19:37
(Received via mailing list)
I have a helper:

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

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

<%= 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 D.
This topic is locked and can not be replied to.