I have a Rails application that uses the friendly_id
Gem.
Using Friendly ID works well.
However, there are some paths in the backoffice where I do not want to use the Friendly ID slug in the URI, as it is not possible to use the same scopes as in the front-end.
e.g. I have an article that can have multiple versions. On each blog on the front, another article version is shown. Therefore, I can use @blog.articles.friendly.find(params[:id])
. However, in the backoffice, I have pages where people can edit such a version, which is not nested under a Blog (because it is possible for a version to change blog using the form). Therefore, article versions that have the same slug as an earlier one will become inaccessible.
How can I instruct friendly_id
and/or the Rails URL helper to not use the slug for these paths, but just use the good old numerical ID instead?