I was attempting to cache an action that had a URL like this:
which returns different data than, say
However, the cached fragment would always be named
foo.com:3000/controller/action.cache, no matter what parameters where
passed in, which would result in incorrect data being rendered on a
I eventually tracked the culprit to ActionController::Base#url_for,
which the fragment cacher calls well reading and writing the fragment.
In my controller, I added this:
def url_for(options = nil, *parameters_for_method_reference)
super( options ? options : params, parameters_for_method_reference)
which sends the params hash as options, if no options are specified
(as is the case with the cacher).
So is this a bug in rails or a misunderstanding on my part as to the
proper behavior? Am I doing something dangerous here by fiddling with
one of the more used methods?