Reputation: 249
I have the following routes output:
http://localhost:3001/chefs/peter (shows the chef profile **based on username**)
http://localhost:3001/chefs/edit (can edit their profile if logged)
How to prevent user to create a username that already has a action name like edit?
Upvotes: 1
Views: 78
Reputation: 2694
I think there should be more than one solution but using exclusion validation should work.
validates :name, :exclusion => { :in => %w(edit show) }
Upvotes: 1