instance method
render_to_string
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
render_to_string(options = nil, &block)
Renders according to the same rules as render, but returns the result in a string instead of sending it as the response body to the browser.
Parameters
-
optionsopt = nil -
blockblock
Source
# File actionpack/lib/action_controller/base.rb, line 947
def render_to_string(options = nil, &block) #:doc:
render(options, &block)
ensure
response.content_type = nil
erase_render_results
reset_variables_added_to_assigns
end
Defined in actionpack/lib/action_controller/base.rb line 947
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Base