Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using render(...) and return in example code #45927

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

r7kamura
Copy link
Contributor

@r7kamura r7kamura commented Sep 1, 2022

Summary

In the Rails Guides and documentation, there are several examples of using render(...) and return, but this is confusing code for beginners and should be avoided as much as possible in favor of the normal return use.

@rafaelfranca rafaelfranca merged commit ba36ae0 into rails:main Sep 1, 2022
@r7kamura r7kamura deleted the feature/and-return branch September 1, 2022 23:01
artfuldodger added a commit to artfuldodger/rails that referenced this pull request May 31, 2024
An action can _contain_ multiple renders/redirects, but only one can be _performed_.

Also removes the `and return` recommendation in order to be consistent with the documentation updates from rails#45927
artfuldodger added a commit to artfuldodger/rails that referenced this pull request May 31, 2024
An action can _contain_ multiple renders/redirects, but only one can be _performed_.

"Attempting to try to" is redundant.

Also removes the `and return` recommendation in order to be consistent with the documentation updates from rails#45927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants