instance method
render_to_string
Ruby on Rails 8.0.4
Since v3.1.12Signature
render_to_string(*)
Similar to #render, but only returns the rendered template as a string, instead of setting self.response_body.
Parameters
-
argsrest
Source
# File actionpack/lib/action_controller/metal/rendering.rb, line 174
def render_to_string(*)
result = super
if result.respond_to?(:each)
string = +""
result.each { |r| string << r }
string
else
result
end
end
Defined in actionpack/lib/action_controller/metal/rendering.rb line 174
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Rendering