method
render_to_string
v1.2.6 -
Show latest stable
- Class:
ActionController::Base
render_to_string(options = nil, &block)protected
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.
2Notes
No Layout, other options
While it renders to the same rules as render, you need to specify params.
You'd think this would work: render_to_string "users/profile", :layout => false
You need to do this instead render_to_string(:layout => "users/profile", :layout => false)
No Layout (fixed typo)
@wiseleyb: Seems to be a typo, should be:
render_to_string(:action => "users/profile", :layout => false)