Seamus Gilchrist
2006-Jul-07 19:24 UTC
[Rails] disabling a layout before calling javascript window.open
Hi, I have some code in which i open a pop up when a user clicks on a link. However, the new popup window comes with the layout of the page on which the user clicked the link. I would like to remove the layout only from the new window which is created with the javascript window.open - any ideas thanks -- Posted via http://www.ruby-forum.com/.
Jonathan Motta
2006-Jul-07 19:34 UTC
[Rails] disabling a layout before calling javascript window.open
I''f you''ve already got a render, redirect_to, or render_partial in the method generating the page for the popup, just add ":layout => false" to it''s list of arguments. Otherwise, maybe try the following as the last line of your popup action method. render :layout => false Seamus Gilchrist wrote:> Hi, > > I have some code in which i open a pop up when a user clicks on a link. > However, the new popup window comes with the layout of the page on which > the user clicked the link. I would like to remove the layout only from > the new window which is created with the javascript window.open - any > ideas > > thanks > >
Seamus
2006-Jul-11 03:40 UTC
[Rails] Re: disabling a layout before calling javascript window.open
Jonathan Motta wrote:> I''f you''ve already got a render, redirect_to, or render_partial in the > method generating the page for the popup, just add ":layout => false" to > it''s list of arguments. Otherwise, maybe try the following as the last > line of your popup action method. > > render :layout => falseJonathan, thanks for the suggestion but i have not had any success with it. The javascript to open the window is in the layout and not in a particular controller. The controller (question_controller.rb, method new_question) brings up a layout with a paragraph of text (view new_question.rhtml), and when someone clicks on a hyperlink in the text that is presented with this layout, it pops up a smaller window that has the same layout. THis is the layout I want to get rid of but i have tried putting the render :layout => false in the code at various places with no success. If I put it in the layout file, i lose the layout completely and the pop-up does not seem to open the new window. thanks for any advice or suggestions seamus -- Posted via http://www.ruby-forum.com/.