Repository navigation
Conversation
AbstractController::Rendering#render_to_body is an empty hook: the including class supplies the body through ActionView::Rendering, ActionController::Renderers and ActionController::Rendering, and ActionController::Rendering never returns nil (`super || ... || " "`). The generated `-> nil` described only the empty default, so tools that type an override from the method it overrides typed every controller render_to_body as nil. Streaming renders return a body object rather than a String, so the hook returns untyped. The declaration and its Rails doc move to actioncontroller.rbs beside render_to_string. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01SEntZKsZwQHhzqcwG7MTqn
|
@apiology Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|
The tests sat next to the ones ruby#1115 adds, so whichever merged second would conflict. At the end of each file the two PRs touch separate hunks.
|
@apiology Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|

Claude: This PR was written by Claude Code on behalf of @apiology.
Problem:
The abstract
render_to_bodyis typednil, though controllers always render a body:Tools that type a method from the one it overrides then type every controller's
render_to_bodyasnil, thoughActionController::Rendering#render_to_bodyendssuper || _render_in_priorities(options) || " ".Solution: Declare
AbstractController::Rendering#render_to_body, an empty hook its including classes fill in, as returninguntypedinactioncontroller.rbsfor 7.2 and 8.1, moving its Rails doc out of the generated file.It returns
untypedrather thanStringbecause streaming renders return a body object (_render_template). 6.0 is unchanged, pergems/actionpack/README.md.