I have a users_controller. I’ve created a portfolios_controller which I would like to act similarly to the users_controller; so GETing /portfolios/10 would actually pull the user with an id of 10. I’m not quite sure how to set up my routes for this. Here’s what I have right now in routes.rb:
get "portfolios/show"
resources :users
I got the following error when trying to access /portfolios/10: The action '10' could not be found for PortfoliosController.
Thoughts?
I would try a
matchstatement with an:idparameter instead:Then you will have access to
params[:id]in that action.