Closed PaulooMartin closed 10 months ago
Yeah you're absolutely correct on this one. It should say something like
The before_action method takes the symbol of the method to run before anything else gets run in the controller. If the method uses a render or redirect, the target controller action won't execute.
Would you be interested in making this change @PaulooMartin ? If not, that's okay, we can get someone else on it.
Hey @JoshDevHub, thanks for getting back at this.
Unfortunately, I am too busy these times so I wouldn't be able to take the time to make the change.
No problem. Thanks for spotting this issue in the curriculum @PaulooMartin :raised_hands:
Hey! I'm available to contribute to this issue!
While at it, I propose the addition of hyperlinks to the docs on occurrences of this sort, so the student can actually go directly to the documentation instead of blindly accepting what is said as truth. Or it would be better, in your opinion, that we encourage independent look-up of the said documentation?
Thank you for volunteering @stxss
I think we can go without a link to the docs. There's already a link to the Rails guides content on controller filters in the assignment at the end of the lesson. So learners should eventually read this from the documentation anyway.
Describe your suggestion
This paragraph under Controller Filters contains incorrect / incomplete information.
According to this rails api for before_action, the action does not run if the callback redirects or renders something else.
I also tested this out with my members-only app, the information from TOP did not match the result I got. The result I got was similar to the rails-api or rails-guides.
Path
Ruby / Rails
Lesson Url
https://www.theodinproject.com/lessons/ruby-on-rails-sessions-cookies-and-authentication#controller-filters
Checks
(Optional) Discord Name
No response
(Optional) Additional Comments
No response