Ye Dingding
2007-Jun-28 18:11 UTC
How to avoid auto-closing tag while using insert_html method?
It seems that page.insert_html :bottom, ''current-entry'', ''<div id="cc" >'' will generate <div id="cc"/> automatically. That is, it auto-close the ''div'' tag. However, this is not i want. What I want is a unclosing tag. So, Is there any way to achieve the goal? thx. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2007-Jun-28 18:22 UTC
Re: How to avoid auto-closing tag while using insert_html method?
On Jun 28, 2007, at 2:11 PM, Ye Dingding wrote:> It seems that > page.insert_html :bottom, ''current-entry'', ''<div id="cc" >'' > will generate <div id="cc"/> automatically. That is, it auto-close > the ''div'' tag. > > However, this is not i want. What I want is a unclosing tag. So, Is > there any way to achieve the goal? > > thx.I think that the HTML fragment has to be "complete" so it''s not valid to do what you ask. Perhaps you could state what your true goal is? Or explain the other options that you''ve considered and why an opening <div> is what you think you need. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ye Dingding
2007-Jun-28 18:58 UTC
Re: How to avoid auto-closing tag while using insert_html method?
On 6/29/07, Rob Biedenharn <Rob-GBZH0y1GwQfnZcttdmLDtcI/UQi/AW5J@public.gmane.org> wrote:> > On Jun 28, 2007, at 2:11 PM, Ye Dingding wrote: > > It seems that > page.insert_html :bottom, ''current-entry'', ''<div id="cc" >'' > will generate <div id="cc"/> automatically. That is, it auto-close the > ''div'' tag. > > However, this is not i want. What I want is a unclosing tag. So, Is there > any way to achieve the goal? > > thx. > > > I think that the HTML fragment has to be "complete" so it''s not valid to > do what you ask. Perhaps you could state what your true goal is? Or explain > the other options that you''ve considered and why an opening <div> is what > you think you need. >I want the inner_html in the div can be replacable. That''s, page.replace_html "cc", :partial => "xxx" If it''s not valid, i''ll turn to use another way to change the content. -Rob> > Rob Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2007-Jun-28 19:53 UTC
Re: How to avoid auto-closing tag while using insert_html method?
On Jun 28, 2007, at 2:58 PM, Ye Dingding wrote:> On 6/29/07, Rob Biedenharn <Rob-GBZH0y1GwQfnZcttdmLDtcI/UQi/AW5J@public.gmane.org> wrote: > On Jun 28, 2007, at 2:11 PM, Ye Dingding wrote: >> It seems that >> page.insert_html :bottom, ''current-entry'', ''<div id="cc" >'' >> will generate <div id="cc"/> automatically. That is, it auto-close >> the ''div'' tag. >> >> However, this is not i want. What I want is a unclosing tag. So, >> Is there any way to achieve the goal? >> >> thx. > > I think that the HTML fragment has to be "complete" so it''s not > valid to do what you ask. Perhaps you could state what your true > goal is? Or explain the other options that you''ve considered and > why an opening <div> is what you think you need. > > I want the inner_html in the div can be replacable. That''s, > page.replace_html "cc", :partial => "xxx" > If it''s not valid, i''ll turn to use another way to change the content.If that is something that will happen in some future request, then ''<div id="cc" />'' should be able to handle the equivalent of: $(''cc'').innerHTML = "partial xxx" <div id="cc" /> is the same as <div id="cc"></div> Try it and see! -Rob> > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---