Hi all. My code is in a controller I want to be able to call "render" (or something else) to be able to get well formatted HTML from a very special :partial that I have. This HTML will not go to the user. I will subsequently call "render" once for the page I want displayed to the user. I believe I can accomplish this in a view by a call to render. However, I want/need to be able to do this in the controller. Raw ERB does not seem like the right answer as I''d like to have access in the .rhtml file to all the stuff setup by the controller. Thanks in advance. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Oct-01 22:55 UTC
Re: getting the "to be rendered" html w/o rendering it!
> My code is in a controller > > I want to be able to call "render" (or something else) to be able to get > well formatted HTML from a very special :partial that I have. This HTML > will not go to the user. > > I will subsequently call "render" once for the page I want displayed to > the user. > > I believe I can accomplish this in a view by a call to render. However, > I want/need to be able to do this in the controller. > > Raw ERB does not seem like the right answer as I''d like to have access > in the .rhtml file to all the stuff setup by the controller.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. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---