Skip to content

Commit 57609e3

Browse files
committed
actioncontroller: fix render_to_string method signature
The block is optional.
1 parent dc2db32 commit 57609e3

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

gems/actionpack/6.0/_test/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ def fetch
4848
post :quux
4949
end
5050
end
51+
52+
ActionController::Base.new.render_to_string(template: 'foo', locals: { bar: 'baz' })

gems/actionpack/6.0/actioncontroller.rbs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,9 @@ module ActionController
276276
| (untyped key, untyped args) -> untyped
277277
end
278278
end
279+
280+
module ActionController
281+
module Rendering
282+
def render_to_string: (*untyped args) ?{ () -> untyped } -> ::String
283+
end
284+
end

gems/actionpack/6.0/actionpack-generated.rbs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -511,18 +511,6 @@ module AbstractController
511511
# sticks the result in <tt>self.response_body</tt>.
512512
def render: (*untyped args) { () -> untyped } -> untyped
513513

514-
# Raw rendering of a template to a string.
515-
#
516-
# It is similar to render, except that it does not
517-
# set the +response_body+ and it should be guaranteed
518-
# to always return a string.
519-
#
520-
# If a component extends the semantics of +response_body+
521-
# (as ActionController extends it to be anything that
522-
# responds to the method each), this method needs to be
523-
# overridden in order to still return a string.
524-
def render_to_string: (*untyped args) { () -> untyped } -> untyped
525-
526514
# Performs the actual template rendering.
527515
def render_to_body: (?::Hash[untyped, untyped] options) -> nil
528516

@@ -2748,9 +2736,6 @@ module ActionController
27482736

27492737
def render: (*untyped args) -> untyped
27502738

2751-
# Overwrite render_to_string because body can now be set to a Rack body.
2752-
def render_to_string: () -> untyped
2753-
27542739
def render_to_body: (?::Hash[untyped, untyped] options) -> untyped
27552740

27562741
private

0 commit comments

Comments
 (0)