File tree Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,5 @@ def fetch
48
48
post :quux
49
49
end
50
50
end
51
+
52
+ ActionController ::Base . new . render_to_string ( template : 'foo' , locals : { bar : 'baz' } )
Original file line number Diff line number Diff line change @@ -276,3 +276,9 @@ module ActionController
276
276
| (untyped key, untyped args) -> untyped
277
277
end
278
278
end
279
+
280
+ module ActionController
281
+ module Rendering
282
+ def render_to_string : (*untyped args) ?{ () -> untyped } -> ::String
283
+ end
284
+ end
Original file line number Diff line number Diff line change @@ -511,18 +511,6 @@ module AbstractController
511
511
# sticks the result in <tt>self.response_body</tt>.
512
512
def render : (*untyped args) { () -> untyped } -> untyped
513
513
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
-
526
514
# Performs the actual template rendering.
527
515
def render_to_body : (?::Hash[untyped , untyped ] options) -> nil
528
516
@@ -2748,9 +2736,6 @@ module ActionController
2748
2736
2749
2737
def render : (*untyped args) -> untyped
2750
2738
2751
- # Overwrite render_to_string because body can now be set to a Rack body.
2752
- def render_to_string : () -> untyped
2753
-
2754
2739
def render_to_body : (?::Hash[untyped , untyped ] options) -> untyped
2755
2740
2756
2741
private
You can’t perform that action at this time.
0 commit comments