-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Improve documentation of ActionView:RenderingHelper#render
#52520
Conversation
8c407bb
to
c6658ac
Compare
ActionView:RenderingHelper#render
[ci-skip]ActionView:RenderingHelper#render
c6658ac
to
6100391
Compare
Looks good to me. |
@@ -1,5 +1,7 @@ | |||
# frozen_string_literal: true | |||
|
|||
# :markup: markdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I ran tools/rdoc-to-md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skipkayhil Do you think it's good to go now?
The current documentation `RenderingHelper#render` doesn't document all options and documents an the outdated `:update` argument. The documentation of `ActionController::Rendering#render` is much more complete. It shows example code for the different rendering modes, has a separate section for other arguments and reads a lot better as well. This change copies the documentation from `ActionController::Rendering` and updates it to make sense for ActionView: - The `response formats` is replaced with `formats`. - The `assigns`, `status` and `layout` options are removed as the aren't supported. - The `:formats`, `:variants`, and `:handlers` options are added. This also removes the `:update` option which is no longer supported.
6100391
to
bb736cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, looks great!
Thanks @skipkayhil and @willianveiga ! |
Motivation / Background
The current documentation
RenderingHelper#render
doesn't document all options and documents an the outdated:update
argument.The documentation of
ActionController::Rendering#render
is much more complete. It shows example code for the different rendering modes, has a separate section for other arguments and reads a lot better as well.Detail
This change copies the documentation from
ActionController::Rendering
and updates it to make sense for ActionView:response formats
is replaced withformats
.:json
rendering mode, which isn't supported.assigns
,status
andlayout
options are removed as the aren't supported.:formats
,:variants
, and:handlers
options are added.This also removes the
:update
option which is no longer supported.The following script allows reproducing the render modes and options:
Which results in:
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]