I currently have a users model and controller, whenever a user is created it makes there profile url at example.com/users/userid. I also have a users/new page and a users/index page. The issue is that when I try to create a users/selected users page rails thinks its a user id and gives me this error. “Couldn’t find User with id=selectedusers.” I’ve previously been able to fix this by directly calling the pages in the controller e.g index, or new but I’m not sure how to handle a page that doesent have a function in the controller. Thank you
Share
It’s about the order of the routes. If you put the code that defines the
selectedroute beforeresources :users, then everything should be fine.Where does the
users/selectedroute points to? Because you could define your routes like that:and have a
selectedmethod in your controller.