I wanted to know if this can be done knowing the following:
the parameter that I want to show instead of
id
is the name and in the database it is not a unique parameteri wish i could take the parameter
id
so i can then display the other parameter which is not unique in the database (name)
Can this be done? I will leave the route I use for this case:
get 'user/:id' => 'users#userProfile', as: 'user_profile'
first of all, Thanks.
Yes it can, your best option is to use the " Friendly ID " gem, which internally will take care of generating the necessary mapping between the real ids and those shown in your url. This type of ID is the one used in many blogs and even in some news pages.