I've been tooling with a route where:
query being a url escaped string, which I place in the URL with
a normal '?query=foo' is appended and the query page isn't cached, but
if the JS does run, the user gets a normal prettyish URL that can be
The problem is, given a query of:
'kinnard city:"los angeles"' (obviously ferret here)
which the controller handles smoothly. The page is cached, however, as:
That means subsequent requests will not hit the cached file, and instead
will be run every time. I'm thinking this has to do with the
re-generation of the URL for the cache file on line 133 of
self.class.cache_page(content || response.body,
url_for(options.merge(:only_path => true, :skip_relative_url_root =>
true, :format => params[:format])))
Is there an issue with using a regex or some alternative? Maybe a way
to stop url_for from changing spaces into + signs?
Hm, answering my own question I might replace spaces with + signs inside
the URL, but I wonder if my query will be read properly by the
controller then. It still raises the oddness of Rails reading
the :query one way, and caching it in a completely other one.
I'm sure this has been hit before, ideas?