I’am using the friendly_id gem in my rails app, to create nice clean url’s. It’s working out good, but the page are also attainable by te record id.
Example:
I’ve a record with ‘name’ as slug. This record has 1 for ID.
So the page is attainable from 2 url’s:
domain.com/name
and
domain.com/1
I want only to use domain.com/name, so I dont want the page to be attainable from domain.com/1.
Does anyone know how to accomplish this?
From the author himself (Google is your friend; this is a top result when searching
friendly_id disable find id): https://github.com/norman/friendly_id/issues/146Either way, you need to replace occurences of
findwith one of the alternatives above to tell your application to ignore the:idcolumn.