I need to use a view to generate some text, using render_to_string. The
form I am using is:
render_to_string :template => "foo/bar"
The problem is that this form does not accept the :locals attribute.
Therefore any variables I want to be accessible in the view must be
I understand that this is standard view behavior, but whereas the point
of most controllers is to generate instance variables for the view, in
my case that’s secondary. And this scheme means I have to think through
ahead of time what will be displayed in the view and make sure that
variable has an @ in front of it.
Is there a more concrete way of passing local variables to this form of