Inside an iframe, I want the controller to redirect_to to the parent (i.e. target =''_parent''). Any ideas? (Everything I''ve tried- via redirect_to - just keeps it inside the iframe)
On May 7, 7:43 pm, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote:> Inside an iframe, I want the controller to redirect_to to the parent > (i.e. target =''_parent''). > Any ideas? > (Everything I''ve tried- via redirect_to - just keeps it inside the > iframe)i don''t think you can do this server side - you need to set the right target attribute etc on the link and so on. Fred
nextpulse wrote:> Inside an iframe, I want the controller to redirect_to to the parent > (i.e. target =''_parent''). > Any ideas? > (Everything I''ve tried- via redirect_to - just keeps it inside the > iframe) > >use responds_to_parent plugin tom -- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ===============================================================================
thanks. Seems like I may have to render some JS in the controller to call the parent. On May 7, 11:46 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 7, 7:43 pm, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote: > > > Inside an iframe, I want the controller to redirect_to to the parent > > (i.e. target =''_parent''). > > Any ideas? > > (Everything I''ve tried- via redirect_to - just keeps it inside the > > iframe) > > i don''t think you can do this server side - you need to set the right > target attribute etc on the link and so on. > > Fred
I used a quick workaround. Replace the redirect_to with: render :text => "<html><body><script type=''text/javascript'' charset=''utf-8''>window.parent.document.location.href = ''/myloc'';</ script></body></html>" On May 7, 11:51 am, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote:> thanks. > Seems like I may have to render some JS in the controller to call the > parent. > > On May 7, 11:46 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On May 7, 7:43 pm, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote: > > > > Inside an iframe, I want the controller to redirect_to to the parent > > > (i.e. target =''_parent''). > > > Any ideas? > > > (Everything I''ve tried- via redirect_to - just keeps it inside the > > > iframe) > > > i don''t think you can do this server side - you need to set the right > > target attribute etc on the link and so on. > > > Fred
I think this works better: <script>parent.location.href=''/foo'';</script> Kiyoshi On 7 maio, 17:18, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote:> I used a quick workaround. Replace the redirect_to with: > > render :text => "<html><body><script type=''text/javascript'' > charset=''utf-8''>window.parent.document.location.href = ''/myloc'';</ > script></body></html>" > > On May 7, 11:51 am, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote: > > > thanks. > > Seems like I may have to render some JS in the controller to call the > > parent. > > > On May 7, 11:46 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > On May 7, 7:43 pm, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote: > > > > > Inside an iframe, I want the controller to redirect_to to the parent > > > > (i.e. target =''_parent''). > > > > Any ideas? > > > > (Everything I''ve tried- via redirect_to - just keeps it inside the > > > > iframe) > > > > i don''t think you can do this server side - you need to set the right > > > target attribute etc on the link and so on. > > > > Fred