Forum: Ruby on Rails pretty urls with to_param and rails sweepers problem

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.
Ingo W. (Guest)
on 2007-04-14 09:44
Hi all,

as seems to be quite common, I am overriding to_param for some of my
models to get nicer urls. For example:


instead of


I understand the argument in favor of numeric ids, but in this case I am
using ISO standard codes so I figured that should be OK even for the
most puristic of purists.

It worked just fine for quite a while until I started using sweepers to
clear my page cashes. Turns out that in contrast to url_for, the sweeper
constructs urls using the standard numeric ids instead of my custom
ones, and hence fails to expire the pages correctly.

Is it possible to work around that somehow?

This topic is locked and can not be replied to.