Open ericpeters0n opened 10 years ago
To do this, you need to handle it manually - there isn't a super nice way. I'd suggest being explicit - Override #to_param
on your model to return your preferred (e.g. id / slug) and then use the other explicitely. You could use a switch (ideally using Thread.current or something better - so it's request-local), but note that isn't super clean and it'd honestly be preferable to be explicit.
Making a model sluggable appears to force the use of the slug in routing, rather than making it an option. Is it possible to use the slug -or- (not instead of) default row/model id in routing?