Hello, I have an iframe in my page that for some reason is rendering all of the code from the parent page. Basically what I have going is the parent page with its wrapper and header and all that just getting repeated with in the iframe even though all the those divs are not explicitly coded in to the iframe. Hope that makes sense.Below is any relevant code. iframe [code] <iframe SRC="<%= url_for :action => ''file_add'', :id => @vari%>" FRAMEBORDER="0" WIDTH="100%" HEIGHT="10" ONLOAD="this.height Math.max(this.contentWindow.document.body.offsetHeight,this.contentWindow.document.body.scrollHeight,this.contentWindow.document.documentElement.offsetHeight,this.contentWindow.document.documentElement.scrollHeight);">TODO: no-iframes file uploader</IFRAME> [/code] partial - I tried wrapping it in empty html to remedy this but that didn''t work [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> </head> <body> <% form_tag({:action=> ''file_add'', :id => @proof.id}, {:multipart => true}) do %> <%= hidden_field ''vari'', ''id'' %> <label for="file">Add:</label> <%= file_field_tag ''file'', ''onChange'' => ''this.form.submit();'' %> <%= submit_tag "Add" %> <% end %> <UL> <% @vari.files.each { |file| %> <LI><A HREF="<%= url_for :action => ''file'', :id => @vari, :file_id => file.id, :name => file.name %>"><%=h file.name %></A> from <%=h case file.belongs_to when ''requester'' then @vari.requester.displayName when ''subject'' then @vari.subject.displayName when ''sender'' then @vari.subject.displayName when ''author'' then @vari.author.displayName end %></LI> <% } %> </UL> </body> </html> [/code] -- 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 -~----------~----~----~----~------~----~------~--~---
nextpulse
2008-Feb-25 19:47 UTC
Re: rederded partial in iframe is adopting its parent page''s hea
Its probably picking up your application layout code (app/views/ layout). You''ll need to render without the general layout. On Feb 3, 9:42 pm, is ea <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello, > > I have aniframein my page that for some reason is rendering all of the > code from the parent page. Basically what I have going is the parent > page with its wrapper and header and all that just getting repeated with > in theiframeeven though all the those divs are not explicitly coded in > to theiframe. Hope that makes sense.Below is any relevant code. > > iframe > [code] > <iframeSRC="<%= url_for :action => ''file_add'', :id => @vari%>" > FRAMEBORDER="0" WIDTH="100%" HEIGHT="10" ONLOAD="this.height > Math.max(this.contentWindow.document.body.offsetHeight,this.contentWindow.document.body.scrollHeight,this.contentWindow.document.documentElement.offsetHeight,this.contentWindow.document.documentElement.scrollHeight);">TODO: > no-iframes file uploader</IFRAME> > [/code] > > partial - I tried wrapping it in empty html to remedy this but that > didn''t work > [code] > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> > <head> > <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> > </head> > <body> > <% form_tag({:action=> ''file_add'', :id => @proof.id}, {:multipart => > true}) do %> > <%= hidden_field ''vari'', ''id'' %> > <label for="file">Add:</label> > <%= file_field_tag ''file'', ''onChange'' => ''this.form.submit();'' %> > <%= submit_tag "Add" %> > <% end %> > > <UL> > <% @vari.files.each { |file| %> > <LI><A HREF="<%= url_for :action => ''file'', :id => @vari, :file_id => > file.id, :name => file.name %>"><%=h file.name %></A> from > <%=h case file.belongs_to > when ''requester'' then @vari.requester.displayName > when ''subject'' then @vari.subject.displayName > when ''sender'' then @vari.subject.displayName > when ''author'' then @vari.author.displayName > end %></LI> > <% } %> > </UL> > </body> > </html> > > [/code] > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
nextpulse
2008-Feb-25 19:52 UTC
Re: rederded partial in iframe is adopting its parent page''s hea
i.e in the controller, do a render(:layout=>some_new_layout) On Feb 25, 11:47 am, nextpulse <rob...-pZCIFDiVgMdl57MIdRCFDg@public.gmane.org> wrote:> Its probably picking up your application layout code (app/views/ > layout). > You''ll need to render without the general layout. > > On Feb 3, 9:42 pm, is ea <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > Hello, > > > I have aniframein my page that for some reason is rendering all of the > > code from the parent page. Basically what I have going is the parent > > page with its wrapper and header and all that just getting repeated with > > in theiframeeven though all the those divs are not explicitly coded in > > to theiframe. Hope that makes sense.Below is any relevant code. > > >iframe > > [code] > > <iframeSRC="<%= url_for :action => ''file_add'', :id => @vari%>" > > FRAMEBORDER="0" WIDTH="100%" HEIGHT="10" ONLOAD="this.height > > Math.max(this.contentWindow.document.body.offsetHeight,this.contentWindow.document.body.scrollHeight,this.contentWindow.document.documentElement.offsetHeight,this.contentWindow.document.documentElement.scrollHeight);">TODO: > > no-iframes file uploader</IFRAME> > > [/code] > > > partial - I tried wrapping it in empty html to remedy this but that > > didn''t work > > [code] > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> > > <head> > > <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> > > </head> > > <body> > > <% form_tag({:action=> ''file_add'', :id => @proof.id}, {:multipart => > > true}) do %> > > <%= hidden_field ''vari'', ''id'' %> > > <label for="file">Add:</label> > > <%= file_field_tag ''file'', ''onChange'' => ''this.form.submit();'' %> > > <%= submit_tag "Add" %> > > <% end %> > > > <UL> > > <% @vari.files.each { |file| %> > > <LI><A HREF="<%= url_for :action => ''file'', :id => @vari, :file_id => > > file.id, :name => file.name %>"><%=h file.name %></A> from > > <%=h case file.belongs_to > > when ''requester'' then @vari.requester.displayName > > when ''subject'' then @vari.subject.displayName > > when ''sender'' then @vari.subject.displayName > > when ''author'' then @vari.author.displayName > > end %></LI> > > <% } %> > > </UL> > > </body> > > </html> > > > [/code] > > -- > > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---