I''m guessing you probably have this solved by now, but just in case...
> xml = Builder:: XmlMarkup.new(:target =>
''./inf.xml'', :indent => 1)
Here you are setting the target of a Build::XmlMarkup object to the
string ''./inf.xml'' I''m guessing that''s not
what you really want.
Although, I would guess that Ruby isn''t complaining about that since
your target is an object that responds to the << method.
Try something like this:
f = File.new("./inf.xml", "w")
xml = Builder::XmlMarkup.new(:target => f, :indent => 1)
xml.instruct!
xml.some_tag
f.close
On Nov 4, 5:27 pm, Ramón Castro
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hello
>
> I am trying to create and read an xml. But I am not able to store them
> on a map.
>
> I think so:
> xml = Builder:: XmlMarkup.new(:target =>
''./inf.xml'', :indent => 1)
> xml.id (1)
>
> But I do not know how to save it in the path q I want. Neither as open
> and read it.
>
> Thank you
> --
> Posted viahttp://www.ruby-forum.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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---