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
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.
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
Jonathan,
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.