Closed justwes2 closed 7 years ago
Does this still happen if you place current_user
directly inside of edit_user_goal_path
?
No. That fixed it. Is there a way to alter all user_id instances across a session to always be current user? The structure of my app should not allow for any interaction between siloed user experiences.
Interesting. Not sure why current_user
worked there and @user
didn't (aside from working on the wrong controller action).
I think using current_user
wherever you would have written out @user
is the DRY-est solution. You're going to have to pass a user into those path helpers no matter what, and the shortest way is to avoid defining it in a controller action altogether.
I don't want to open a new issue for this, since the documentation is the same, but now that I can edit stuff, the program is spitting out the original goal and the edited goal to my index printout. Do I need to call the put method explicitly somewhere? I checked the scribbler solution branch, and I don't see where my code is different.
I'm getting this error: No route matches {:action=>"edit", :controller=>"goals", :id=>"1", :user_id=>nil} missing required keys: [:user_id]. The line in question is:
The edit on the controller is:
and my repo is linked here: https://github.com/justwes2/wellnyss I'm not sure what I'm missing to access the edit_user_goal here.