I have a problem, I use a find.params[:id] to display a user from a
list, and then I want to edit that information. I have a separate
action for the edit, named change_user_details, and I retrieve the
user id the same way I do for the audit_user with find.params[:id].
The problem is that the action change_user_details does not want to
retrieve the current viewed user id. It gives the error Couldn't find
User without an ID.
Here is the code of the two actions and the two forms.
def audit_user
@user = User.find(params[:id])
end
def change_user_details
@user = User.find(params[:id])
end
I have a problem, I use a find.params[:id] to display a user from a
list, and then I want to edit that information. I have a separate
action for the edit, named change_user_details, and I retrieve the
user id the same way I do for the audit_user with find.params[:id].
The problem is that the action change_user_details does not want to
retrieve the current viewed user id. It gives the error Couldn't find
User without an ID.
Right, because params[:id] is empty.
Here is the code of the two actions and the two forms.
def audit_user
@user = User.find(params[:id])
end
def change_user_details
@user = User.find(params[:id])
end