How to render a template in a pop-up window?

Hi all!

I haven’t been able to find the way to do this (apparently) simple task:

I have a controller that renders “template1” when called the first time
and “template2” when called the second time. I want these templates to
be opened as pop-up windows in the client’s browser, so he can browse
their contents simultaneously.

Anyone has a clue of how can do I do that???

Thanks,
Federico

Hm, can you not modify the link to include target="_blank" for the
second case?

JohanR wrote:

Hm, can you not modify the link to include target="_blank" for the
second case?

MMMM I’m rendering with redirect_to :action => template(1…5). There I
don’t have that option, but you gave me an idea. Perhaps I could do a
redirection in a template and there put the target = “_blank”. I’ll give
it a try.

Thanks!
Federico

link_to has a popup option, check out
http://api.rubyonrails.org/classes/ActionView/Helpers/
UrlHelper.html#M000378

Best,
Thomas

Am 20.08.2006 um 12:14 schrieb JohanR:

Thomas F. wrote:

link_to has a popup option, check out
http://api.rubyonrails.org/classes/ActionView/Helpers/
UrlHelper.html#M000378

Best,
Thomas

Am 20.08.2006 um 12:14 schrieb JohanR:

Yes, but I need to open the pop-up from a controller.

Something like:

class SomeController

def action


render “template_as_popup”
end

Unfortunately redirect_to doesn’t have the options of link_to, so I
can’t do this in template_as_popup.rhtml:

<% redirect_to “something”, :popup => true %>

:frowning: