Ruby on Rails Thursday, October 28, 2010

On Thu, Oct 28, 2010 at 4:53 PM, Marnen Laibow-Koser <lists@ruby-forum.com> wrote:

David Kahn wrote in post #957906:

> Do you know
> offhand if I can just instantiate this controller and still call one of
> it's
> methods to string from a different controller or even better from a
> model?

render_to_string :controller => 'some_other_controller', :action =>
'export_file'

That should be all you need, just like plain old render.  Does that not
work?

Ok, I am loosing my mind, yes, this works beautifully! I did not make the connection between render_to_string and the normal render action being of the same abilities.
 

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment