I have a User model, it is a backup resource and has default methods, such as index, show, new, create and others.
Now I want to define a new action "current_user" to show information about the currently logged in user, which is different from "show".
When i use:
link_to current_user.name, :controller=>'users', :action=>'current_user'
Generated url and http://localhost:3000/users/current_usererror message:
Couldn't find User with ID=current_user
Should I Change routes.rb? What should I do?
I searched for some articles and still don't know.
source
share