stevemolitor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-11 03:32 UTC
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up! Thanks. Steve --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 6/10/07, stevemolitor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <stevemolitor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by > default? I know I can use tag!, but I''d like to find a way for it to > translate underscores to dashes automatically. In other words: > > xml.department_manager do > "fred > endxml.tag! ''department-manger'', ''fred'' -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---
stevemolitor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-12 15:42 UTC
Re: Builder::XmlMarkup and dashes
Right, I know about ''tag!'' but I was hoping to rig things such that XmlMarkup always called ''dasherize'' on element names. Steve On Jun 11, 1:09 am, "Rick Olson" <technowee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 6/10/07, stevemoli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <stevemoli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Has anyone hacked Builder::XmlMarkupto dasherize underscore tags by > > default? I know I can use tag!, but I''d like to find a way for it to > > translate underscores todashesautomatically. In other words: > > > xml.department_manager do > > "fred > > end > > xml.tag! ''department-manger'', ''fred'' > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.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 -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- Eager load associations in Oracle problem with more than 1000 records
- is it possible to make to_xml use underscore instead of dash?
- AR to_xml problem with associations, Builder::XmlMarkup#to_a
- Example using Builder::XmlMarkup and .rxml files?
- Builder::XmlMarkup adds <inspect/> on printing and <clone/> on saving