method

render_to_string

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

wiseleyb · May 11, 20101 thank

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)

ledermann · Sep 17, 20101 thank

@wiseleyb: Seems to be a typo, should be:

render_to_string(:action => "users/profile", :layout => false)