Displaying 20 results from an estimated 600 matches similar to: "to_xml for Foo::Bar active records"
2010 May 19
10
R: default subvolume abilities/restrictions
Hi Anthony,
I think that for you may be interested to read this thread
http://kerneltrap.org/mailarchive/linux-btrfs/2009/11/20/6588643/thread
and to read a my blog about this argument
http://kreijack.blogspot.com/2010/01/linux-btrfs-example-of-layout.html
Regards
Goffredo
>----Messaggio originale----
>Da: anthony@extof.me
>Data: 19/05/2010 8.50
>A:
2001 Jan 03
1
chroot.diff
Hi there, everyone;
I've had a few requests for an updated version of my chroot patch. (the
version found in contrib is outdated)
So, here it goes, updated to 2.3.0p1; "chroot.diff" is a plain diff for
session.c (apply, compile and go). "chroot+configure.diff" is the same
patch, plus an option to "configure" for enabling/disabling chroot support
(./configure
2001 May 24
1
chroot sftp-server [PATCH]
I'm working on setting up a semi-trusted sftp service, and to get it
working, I need chroot capability.
I've taken the /./ wuftpd magic token code from contrib/chroot.diff and
put it into the sftp server. The main problem is that privileges have
been dropped by the time the subsystem is exec'ed, so my patch requires
that sftp-server be setuid root. Not ideal, I know, but I drop all
2009 Jan 21
3
Nested serialization with to_json and to_xml with array and hash element
Title: Nested serialization with to_json and to_xml with array and
hash element
class Person < ActiveRecord::Base
has_one :address
has_one :job
def office()
return "Executive_Suite"
end
end
class Address < ActiveRecord::Base
belongs_to :person
end
class Job < ActiveRecord::Base
belongs_to :person
has_one :paygrade
def Title
return "Engineer"
end
end
2007 Feb 21
1
Rendering all the elements when calling Array#to_xml
When I call to_xml on an array, I want it to get the XML for all the
elements in it. I''ve defined to_xml in my class.
>> r.to_xml
=> "<video><id>1</id><views>2</views></video>"
>> a = [r]
=> [#<StatisticsReport:0x3259f38 @video_id=1, @views=2>]
>> a.to_xml
=> "<?xml version=\"1.0\"
2006 Aug 15
2
to_xml and underscores
hi,
i am looking for a solution whereupon
calling myEntityObject.to_xml does not
convert my attributes containing underscores
into hyphens.
at the moment an attribute named "my_own_attribute"
is converted into <my-own-attribute>.
does anybody have an idea how to change that
and have to_xml generate <my_own_attribute>
thanks
ciao robertj
--
Posted via
2007 Feb 15
3
Restrict attributes in to_xml
For example, let''s say I have a User model with 2 attributes:
1. pw_hash
2. pw_salt
I don''t want these to show up in the to_xml method. How do I keep to_xml
from using these attributes?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Jan 21
1
AR to_xml problem with associations, Builder::XmlMarkup#to_a
When I do a to_xml(with a block) on an association 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,
2006 Jun 19
6
to_xml depth ...
hello,
The "render :xml => myFriends.to_xml", return something like:
<people>
<person>
<id type="integer">2</id>
...
<person>
But a Person has a "has_many" relationship and they are not in the xml,
=> so is it possible to change the depth of the marshall process ?
if it not possible, what are the "rails
2006 Jul 14
1
creating a computed column with activerecord for to_xml
Hi. I have a question about activerecord, computed columns and to_xml.
I have a simple model called person that has a first_name and a
last_name field (and thus a first_name and last_name field in the Person
table). When I :find a model and call to_xml, I would like the result
to not only send back first name and last name as xml but also add an
additional attribute called full_name that is
2010 Feb 11
2
Inconsistent Hash#to_xml Method
I have a unit test that demonstrates some inconsistent behavior with a
Hash being converted to XML with the :root option. Sometimes it works
fine:
Hash.new.to_xml(:root => ''test'')
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test>\n</test>\n"
But sometimes I get an argument error:
Hash.new.to_xml(:root =>
2010 Mar 08
1
to_xml repeating elements and plain strings
Say I want to output XML like this:
<myXML>
<id>123</id>
<fruit>apple</fruit>
<fruit>banana</fruit>
<fruit>pear</fruit>
<fruit>lemon</fruit>
</myXML>
Is there a way of doing that with to_xml?
It seems like there''s two problems: to_xml always creates a wrapping
element <fruits> when it encounters an
2007 Dec 12
2
to_xml ignore fields
Hi!
I''d like to know how to (most easily) ignore some elements from produced
XML ..
for example: @people.to_xml produces:
<person>
<id>2</id>
<name>bob</name>
<street>carson street</street>
</person>
...
How can I *not* produce the "ID" field for example?
Thank you!
--
Posted via http://www.ruby-forum.com/.
2006 Jul 31
0
to_xml using lots of memory
to_xml uses up huge amounts of memory. Whether I use to_xml on an
activerecord object directly, or create a hash from the activerecord
object and then call to_xml on the hash, creating a 1.6mb xml file
eats up 50mb of ram in rails.
2008 Apr 22
0
Overriding to_xml() - Why Does This Work?
In Chapter 5 of his book, Flexible Rails, Peter Armstrong''s leads his
readers through an exercise to override the behavior of to_xml() in
ActiveRecord objects so that :dasherize would be false by default. I
found his solution inelegant. I came up with a more elegant one, and
it seems to work.
All I did was add the following to the very end of myapp/config/
environment.rb:
class
2010 Feb 20
1
Advanced use of to_xml and to_json
Hello,
I''m working on a Rails app which has a REST API. I manage two formats
JSON and XML.
Very often to simplify the use if the API, I''m making includes. But when
you add params to to_json and to_xml like :only, :except, it''s not only
applied on the root object but on all the objects included.
Do you know libs or methods to answer to these different problems:
* Tell
2007 Nov 20
2
Anyone using to_xml and procs...
I''m looking for comments on http://dev.rubyonrails.org/ticket/10162
In my opinion, the current behaviour is a bug, and should be fixed.
If you have a use case where passing procs to the child associations
is actually useful, chime in.
Jonathan del Strother
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2008 Jun 26
0
Help with to_xml - Add a custom tag in each ele in a coll.
Hi,
I was advised to use either the :methods option of to_xml or use a block
to add additional tags to the output. What I''m trying to do is add a
permalink tag to each element in a collection, but I can''t seem to get
it right.
If I use the :methods option of to_xml, I''d need to access an url helper
from a model, and I haven''t figured that out yet.
When using
2007 May 15
1
Got "Unicode Numeric Entity Codes" after to_xml
Can I get REAL unicode characters after to_xml?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
2007 Sep 30
1
to_xml node names with underscores
When I call to_xml on my active record objects, it replaces
underscores with hypens. E.g.:
<categories>
<category>
<content-provider-id type="integer">1</content-provider-id>
<id type="integer">2</id>
<name>Traffic Alerts</name>
</category>
</categories>
When the actual field is content_provider_id. I remember