I just add friendly_id to beautify my urls.
i get an error
Couldn't find User with 'id'={:id=>"foo"}
Here is my setup
User.rb
class User < ApplicationRecord
extend FriendlyId
friendly_id :last_name, use: %i[slugged finders]
Users_controller.rb
def find_user
@user = User.friendly.find(id: params[:id])
end
I added this to my user table
add_column :users, :slug, :string
add_index :users, :slug, unique: true
And the CreateFriendlyIdSlugs table has been correctly generated
i'm very in trouble with this issue, i'v red all the documentation and i can't see where my code fail
thx for helping