Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gems/actionpack/7.2/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ def matches?(request)
mount Rack::Head.new(->(_env) { [200, { "content-type" => "text/plain" }, ["OK"]] }), at: "/head", as: :head
with_default_scope(module: "v1") { get "ping", to: "ping#show" }.has_named_route?(:ping)
end

# render_to_body returns what the including class renders, so it can be truthy
class BodyRenderer
include AbstractController::Rendering

def show
render_to_body(template: "show") ? "rendered" : "empty"
end
end
6 changes: 6 additions & 0 deletions gems/actionpack/7.2/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ end
class AdminConstraint
def matches?: (ActionDispatch::Request request) -> bool
end

class BodyRenderer
include AbstractController::Rendering

def show: () -> String
end
3 changes: 3 additions & 0 deletions gems/actionpack/7.2/actioncontroller.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ end

module AbstractController
module Rendering
# Performs the actual template rendering.
def render_to_body: (?::Hash[untyped, untyped] options) -> untyped

def render_to_string: (*untyped args) ?{ () -> untyped } -> ::String
end
end
Expand Down
3 changes: 0 additions & 3 deletions gems/actionpack/7.2/actionpack-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,6 @@ module AbstractController
# sticks the result in <tt>self.response_body</tt>.
def render: (*untyped args) { () -> untyped } -> untyped

# Performs the actual template rendering.
def render_to_body: (?::Hash[untyped, untyped] options) -> nil

# Returns Content-Type of rendered content.
def rendered_format: () -> untyped

Expand Down
9 changes: 9 additions & 0 deletions gems/actionpack/8.1/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,12 @@ def matches?(request)
mount Rack::Head.new(->(_env) { [200, { "content-type" => "text/plain" }, ["OK"]] }), at: "/head", as: :head
with_default_scope(module: "v1") { get "ping", to: "ping#show" }.has_named_route?(:ping)
end

# render_to_body returns what the including class renders, so it can be truthy
class BodyRenderer
include AbstractController::Rendering

def show
render_to_body(template: "show") ? "rendered" : "empty"
end
end
6 changes: 6 additions & 0 deletions gems/actionpack/8.1/_test/test.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ end
class AdminConstraint
def matches?: (ActionDispatch::Request request) -> bool
end

class BodyRenderer
include AbstractController::Rendering

def show: () -> String
end
3 changes: 3 additions & 0 deletions gems/actionpack/8.1/actioncontroller.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ end

module AbstractController
module Rendering
# Performs the actual template rendering.
def render_to_body: (?::Hash[untyped, untyped] options) -> untyped

def render_to_string: (*untyped args) ?{ () -> untyped } -> ::String
end
end
Expand Down
3 changes: 0 additions & 3 deletions gems/actionpack/8.1/actionpack-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,6 @@ module AbstractController
# Supported options depend on the underlying `render_to_body` implementation.
def render: (*untyped args) ?{ (?) -> untyped } -> untyped

# Performs the actual template rendering.
def render_to_body: (?::Hash[untyped, untyped] options) -> nil

# Returns `Content-Type` of rendered content.
def rendered_format: () -> untyped

Expand Down
Loading