[Rails] Re: XML Builder

2012-10-25 Thread bwb
My previous post on this question had an error in the resired target description. Here is it aagain; apologies for any confusion: my code looks like this: xml.instruct! xml.county(name: @jurisdiction.name, id: @jurisdiction.jurisdictionID) do xml.officials do @officials.each do |official|

Re: [Rails] Re: XML builder

2010-09-08 Thread radhames brito
xml.count(:date=>service.date, service.code) ^ ^ ^ dot tag hash = attribute no hash = inner value On Wed, Sep 8, 2010 at 6:21 AM, Manish Nautiyal wrote: > bensomers wrote: > > Try using "send" to send the element name. So

[Rails] Re: XML builder

2010-09-08 Thread Manish Nautiyal
bensomers wrote: > Try using "send" to send the element name. So > > element_name = :tag > xml.send(element_name) "Brandon" thanx for your help. It was really helpful how can I add attribute. I want in this format 214 how can I add attribute date. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: XML builder

2010-07-23 Thread bensomers
Try using "send" to send the element name. So element_name = :tag xml.send(element_name) "Brandon" On Jul 21, 2:26 pm, Brandon wrote: > I am using the XML builder and I am frustrated by the lack of being > able to use variables to define the names of XML elements > > I want to be able to do thi

Re: [Rails] Re: XML builder

2010-07-22 Thread Gerardo Gonzalez Cruz
LOL, much easy, i think so :D Happy coding. On Thu, Jul 22, 2010 at 8:30 AM, Ajit wrote: > try > > xml.instruct! > xml.data do >xml.tag "Brandon" > end > > this will give you: > > >Brandon > > > Cheers > > > > On Jul 21, 5:26 pm, Brandon wrote: > > I am using the XML builder and I am

[Rails] Re: XML builder

2010-07-22 Thread Ajit
try xml.instruct! xml.data do xml.tag "Brandon" end this will give you: Brandon Cheers On Jul 21, 5:26 pm, Brandon wrote: > I am using the XML builder and I am frustrated by the lack of being > able to use variables to define the names of XML elements > > I want to be able to do t

[Rails] Re: XML builder

2010-07-22 Thread Frederick Cheung
On Jul 21, 10:26 pm, Brandon wrote: > DESIRED OUTPUT > ... > Brandon > ... > > Does anyone know how I could achieve the desired output using only the > xml builder? have a look at the tag! method Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rai

Re: [Rails] Re: xml builder, dynamic methods

2010-04-16 Thread Chris Habgood
Take success or error in as a text and replace the below with: if type.eql?('success') x.success do x.message "#{msg}" end else x.error do x.message "#{msg}" end end Final version: remove the duplica

[Rails] Re: xml builder, dynamic methods

2010-04-16 Thread Robert Walker
Chris Habgood wrote: > Is there a way to do something like: > > x = Builder::XmlMarkup.new(:target => $stdout, :indent => 1) > x.instruct! > x.response{ > x.X{ > > X is a variable sent in to a method. Can you clarify? I don't understand your question. x.X { ... } would create