I was looking in using an xml_builder template to do something like: blee.xerb xml.blees do <% for blee in @blees %> xml.blee = blee.name <% end %> end It looks like the xml_builder template can''t expand the erb tag. It this not the correct way to expand and xml template ? Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070904/34e19fc5/attachment.html
On Sep 4, 2007, at 3:32 PM, Fernand Galiana wrote:> xml.blees do > <% for blee in @blees %> > xml.blee = blee.name > <% end %> > endTry xml.blees do @blees.each do |blee| xml.blee(blee.name) end end
On Tue, Sep 04, 2007 at 02:32:28PM -0600, Fernand Galiana wrote:> I was looking in using an xml_builder template to do something like: > blee.xerb > xml.blees do > <% for blee in @blees %> > xml.blee = [1]blee.name > <% end %> > end > It looks like the xml_builder template can''t expand the erb tag. > It this not the correct way to expand and xml template ?That''s not xml_builder format, that''s erb format. I think someone else came across the same issue, see http://merb.devjavu.com/projects/merb/ticket/162
Thanks Brian - Well erb sure but I still would like to get the xml builder object bound to the template. That''s the essence of my question ie being able to embed erb tag within my xml template. -Fernand On 9/4/07, Brian Candler <B.Candler at pobox.com> wrote:> > On Tue, Sep 04, 2007 at 02:32:28PM -0600, Fernand Galiana wrote: > > I was looking in using an xml_builder template to do something like: > > blee.xerb > > xml.blees do > > <% for blee in @blees %> > > xml.blee = [1]blee.name > > <% end %> > > end > > It looks like the xml_builder template can''t expand the erb tag. > > It this not the correct way to expand and xml template ? > > That''s not xml_builder format, that''s erb format. > > I think someone else came across the same issue, see > http://merb.devjavu.com/projects/merb/ticket/162 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070904/48283d27/attachment.html
Doh ! Of course... Thanks Michael !!
On Tue, Sep 04, 2007 at 03:37:02PM -0600, Fernand Galiana wrote:> Thanks Brian - Well erb sure but I still would like to get the xml > builder object > bound to the template. That''s the essence of my question ie being able > to embed > erb tag within my xml template.I think you need to choose one or the other. (1) Do you want to write your template in XmlBuilder style? In that case, you can''t embed <% .. %>. However you don''t need to, as a builder template is just Ruby code. If you want to write "for blee in @blees" you just write that; there''s no need to encode it in Erb-style tags. http://builder.rubyforge.org/ (2) Do you want to write your template in Erb style? In that case the template would look something like <blees> <% for blee in @blees %> <blee> <%=h blee.name %> </blee> </blees> However if you do this, and your template is called blees.erb, then until recently Merb would send it as text/html rather than text/xml. That''s what ticket 162 is about. Regards, Brian.