Hi
I like to generate xml like
abc abcHere I want to display id in each user tag. So How can I do that?
Thanks
Brijesh S.
Hi
I like to generate xml like
abc abcHere I want to display id in each user tag. So How can I do that?
Thanks
Brijesh S.
On Jan 6, 5:53 am, Brijesh S. [email protected]
wrote:
Here I want to display id in each user tag. So How can I do that?
require ‘builder’
builder = Builder::XmlMarkup.new(:indent => 2)
xml = builder.users do |users|
(1…2).each do |user_id|
users.user(:id => user_id) do |u|
u.email(“foo”)
end
end
end
puts xml
#=>
foo fooThanks for the help
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs