*Don't* cache *anything*. Or, why is Ajax loved so much?

Every search I’ve done on not caching something in Rails inevitably
turns up with “so you want to cache?”. No!

I’ve got a view that is asking @cart.empty? and answering true, when I
expect it to be false.

Calling out that cart in console yields false, as it should.

Adding and removing from the cart is done via Ajax, and the returned
response populates the view with the cart’s items.

Refreshing said page then tells me the cart is empty.

Is this a caching issue? I haven’t explicitly setup any caching. I’m
running in development with Thin (though I tried Mongrel with the same
results) on Rails 2.0.2.

Any ideas?

Oh, also, logger.debug messages in the controller are not displayed
unless an Ajax request is made.

I’ve seen the latter happen, but only in the console. The debug
messages (logger.debug) are written to the development.log every
time. I’ve been using NetBeans (6.0) and in certain circumstances it
requires the log to be closed and re-opened to see the updates to the

Have you been checking/tailing the log or just checking the console?

On May 20, 3:34 pm, Daniel W. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs