Displaying 4 results from an estimated 4 matches for "skip_instruct".
2006 Jul 31
2
is it possible to make to_xml use underscore instead of dash?
Hi all,
I am getting ActiveRecord to produce XML with
render :xml => @user.to_xml
However, on the client end it is a bit annoying for me to deal with
attributes like first-name. I would much rather have first_name.
Is there any way for me to turn off the behavior of converting _ to -?
This seems to be done by a call to dasherize inside the to_xml of
2009 Jan 21
1
AR to_xml problem with associations, Builder::XmlMarkup#to_a
...tion of a model I got a
Builder::XmlMarkup#to_ary should return Array
Example that does not work.
@intervenant = Intervenant.find(params[:id])
output = @intervenant.to_xml( :skip_types => false, :dasherize =>
false) do |xml|
@intervenant.individu.to_xml( :builder => xml, :skip_instruct =>
true, :skip_types => false, :dasherize => false) do |xml_individu|
#do special stuff at this level.....
end
end
Ex that do work but seems little bit dirty:
@intervenant = Intervenant.find(params[:id])
@individu = Individu.find(params[:id])
output = @i...
2009 Jan 09
2
Confused about to_xml() in ActiveRecord::Base subclass
...fferent behavior, I want to
create my own to_xml.
# Examples online show the following as how to override to_xml:
def to_xml(options = {})
options[:indent] ||= 2
xml = options[:builder] ||= Builder::XmlMarkup.new(:indent =>
options[:indent])
xml.instruct! unless options[:skip_instruct]
# v v v
xml.level_one do
xml.tag!(:second_level, ''content'')
end
# ^ ^ ^
end
end
The code between the v and ^ markers is where the body of each XML
object is generated. If I were generating by hand, I would do
something like this:
errors.each...
2009 Apr 28
0
Writing an imgae tag in to_xml
Hi,
I am trying to create an pdf report by using ruby jasper pages. For that
I have written customer_list.rxml file like this:
xml.instruct!
xml.customer_list_result do
xml.invoice_customers do
@customers.each do |customer|
xml <<
customer.to_xml(:dasherize=>false,:skip_instruct=>true,:only=>[:id,:name,:city],:root=>"customer")
end
end
end
I want to add an image tag into this xml data, so that image will be
displayed on the pdf.
I have customer_image field in customers table.
Can anyone help me out for this?
Thanks,
Tushar
--
Posted via http://w...