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|
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
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/.
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
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
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
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
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
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
9 matches
Mail list logo