Hey, I have a small social network app and i am creating a kind of activity stream for a user. A user can post shouts and photos (models Shout and Photo). These 2 models have a profile_id and place_id (where shout is posted or photo is uploaded). What i want to do now is get an array of these 2 models (objects) to make an xml file like this: <objects ..> <shout>...</shout> <photo>...</photo> <shout>...</shout> ... </objects> I can retreive these models by place_id or by profile_id! How can I do that? Wouter
Please can someone help me! Wouter On 14 aug, 00:29, Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey, > > I have a small social network app and i am creating a kind of activity > stream for a user. > A user can post shouts and photos (models Shout and Photo). > These 2 models have a profile_id and place_id (where shout is posted > or photo is uploaded). > > What i want to do now is get an array of these 2 models (objects) to > make an xml file like this: > > <objects ..> > <shout>...</shout> > <photo>...</photo> > <shout>...</shout> > ... > </objects> > > I can retreive these models by place_id or by profile_id! > > How can I do that? > > Wouter
Wouter wrote:> Please can someone help me! > > WouterDo you *really* think that bumping after less than 24 hours will get people to help you? (Hint: it won''t.) Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
2009/8/13 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Hey, > > I have a small social network app and i am creating a kind of activity > stream for a user. > A user can post shouts and photos (models Shout and Photo). > These 2 models have a profile_id and place_id (where shout is posted > or photo is uploaded). > > What i want to do now is get an array of these 2 models (objects) to > make an xml file like this: > > <objects ..> > <shout>...</shout> > <photo>...</photo> > <shout>...</shout> > ... > </objects> > > I can retreive these models by place_id or by profile_id! > > How can I do that? >How have you setup the relationships (has_many, belongs_to etc) in your models? Or is that what you are asking how to do? Colin
> Do you *really* think that bumping after less than 24 hours will get > people to help you? (Hint: it won''t.)It will :)> How have you setup the relationships (has_many, belongs_to etc) in > your models? Or is that what you are asking how to do?Thank you for helping me! Shout model: belongs_to :place belongs_to :profile Photo model: belongs_to :place belongs_to :profile Place model: has_many :photos has_many :shout So what i want is getting a list of these 2 models combined. It is possible (look @ http://brightkite.com/objects.xml -> also created with ruby on rails) <objects> <photo..> <note..> <..> </objects> so what i want now is for example: http://mybuddynetwork.info/profiles/1-admin/objects.xml and i get then all the photos and shouts from that user! Same for a place (all the photos and shouts at the place). How can i do that? Thank you, Wouter
2009/8/14 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> >> Do you *really* think that bumping after less than 24 hours will get >> people to help you? (Hint: it won''t.) > > It will :)No it didn''t, if you notice I replied to your original not the bump. It was just coincidence. An apology would have been a better response than that above. It is not good to antagonise those that you hope will help you.> >> How have you setup the relationships (has_many, belongs_to etc) in >> your models? Or is that what you are asking how to do? > > Thank you for helping me! > > Shout model: > belongs_to :place > belongs_to :profile > > Photo model: > belongs_to :place > belongs_to :profile > > Place model: > has_many :photos > has_many :shoutThis should be has_many :shouts> > So what i want is getting a list of these 2 models combined. > > It is possible (look @ http://brightkite.com/objects.xml -> also > created with ruby on rails) > <objects> > <photo..> > <note..> > <..> > </objects> > > so what i want now is for example: http://mybuddynetwork.info/profiles/1-admin/objects.xml > and i get then all the photos and shouts from that user! Same for a > place (all the photos and shouts at the place).If you have a place object then the photos are accessible as place.photos and the shouts in place.shouts. These will return arrays of Places and Shouts. Colin
On 14 aug, 18:21, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > >> Do you *really* think that bumping after less than 24 hours will get > >> people to help you? (Hint: it won''t.) > > > It will :) > > No it didn''t, if you notice I replied to your original not the bump. > It was just coincidence. An apology would have been a better response > than that above. It is not good to antagonise those that you hope > will help you. >Yes i know it was coincidence! Sorry for my answer..> > >> How have you setup the relationships (has_many, belongs_to etc) in > >> your models? Or is that what you are asking how to do? > > > Thank you for helping me! > > > Shout model: > > belongs_to :place > > belongs_to :profile > > > Photo model: > > belongs_to :place > > belongs_to :profile > > > Place model: > > has_many :photos > > has_many :shout > > This should be has_many :shouts > > > > > So what i want is getting a list of these 2 models combined. > > > It is possible (look @http://brightkite.com/objects.xml-> also > > created with ruby on rails) > > <objects> > > <photo..> > > <note..> > > <..> > > </objects> > > > so what i want now is for example:http://mybuddynetwork.info/profiles/1-admin/objects.xml > > and i get then all the photos and shouts from that user! Same for a > > place (all the photos and shouts at the place). > > If you have a place object then the photos are accessible as > place.photos and the shouts in place.shouts. These will return arrays > of Places and Shouts. > > ColinHey, But this will make 2 seperate arrays or am i wrong.. i want to have place.shouts and place.photos in the same array.. so like @objects = place.photos and place.shouts (but that don''t work off course) and then i do @objects.to_xml How can i do this? And thank you for helping me! Wouter
2009/8/14 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:>[snip] > But this will make 2 seperate arrays or am i wrong.. > i want to have place.shouts and place.photos in the same array.. > so like @objects = place.photos and place.shouts (but that don''t work > off course) > and then i do @objects.to_xml > > How can i do this?Is that the real question then? It was not clear to me. I have not used to_xml, but a glance at the docs at http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html suggests that associated models can be included by using :include, or have you not managed to get that to work? Colin
Yes that is the question :D i have used include but is not a good option for me.. it includes the model (object) in the child of the xml file like this <objects> <otherobject> <shout></shout> </otherobject> </objects> I managed now to get an array of the shouts and photos like this @objects = [@place.shouts, @place.photos] and i get the objects in the xml file but the xml is like this now: <array type="array"> -<array type="array"> --<array> <body>.. THIS IS PHOTO --</array> -<array type="array"> --<array> <body>.. SHOUT --</array> so i get first the shouts and then the photos and this again in an array.. not how i wanted.. and it has to be sorted on date and not first the photos and then the shouts.. Any idea how to solve that? Wouter On 14 aug, 18:38, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >[snip] > > But this will make 2 seperate arrays or am i wrong.. > > i want to have place.shouts and place.photos in the same array.. > > so like @objects = place.photos and place.shouts (but that don''t work > > off course) > > and then i do @objects.to_xml > > > How can i do this? > > Is that the real question then? It was not clear to me. > > I have not used to_xml, but a glance at the docs athttp://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html > suggests that associated models can be included by using :include, or > have you not managed to get that to work? > > Colin
2009/8/14 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Yes that is the question :DWhat is, I don''t see any question above. Oh, you mean the one half a mile below?> > i have used include but is not a good option for me.. it includes the > model (object) in the child of the xml file like this > <objects> > <otherobject> > <shout></shout> > </otherobject> > </objects> > > I managed now to get an array of the shouts and photos like this > @objects = [@place.shouts, @place.photos] > and i get the objects in the xml file but the xml is like this now: > > <array type="array"> > -<array type="array"> > --<array> > <body>.. > THIS IS PHOTO > --</array> > -<array type="array"> > --<array> > <body>.. > SHOUT > --</array> > > so i get first the shouts and then the photos and this again in an > array.. not how i wanted.. and it has to be sorted on date and not > first the photos and then the shouts.. > Any idea how to solve that? >No idea, sorry. As I said I have not used to_xml Colin [snip]
You should probably use includes or joins in your statement so that you are pulling all the data in together.. -- Posted via http://www.ruby-forum.com/.
Any idea how I can do that? How can i use that? On 14 aug, 18:55, Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> You should probably use includes or joins in your statement so that you > are pulling all the data in together.. > > -- > Posted viahttp://www.ruby-forum.com/.
Wouter wrote:> Any idea how I can do that? How can i use that?@shouts = Shout.find(:all, :include => [:place, :profile]) @photos = Photo.find(:all, :include => [:place, :profile]) You can also use a :joins in the model if you tie it all together properly. This is just a very basic example. Test it out in the rails console then call the data back.. shouts = Shout.find(:all, :include => [:place, :profile]) shouts.place shouts.profile etc... -- Posted via http://www.ruby-forum.com/.
Thank you for your answer!> @shouts = Shout.find(:all, :include => [:place, :profile]) > @photos = Photo.find(:all, :include => [:place, :profile])But with this i got 2 arrays and I need 1 array with all the photos and shouts in it.. and if i do @objects = [@shouts, @photos] and then @objects.to_xml, I get the same as a few posts above: <?xml version="1.0" encoding="UTF-8"?> <arrays type="array"> <array type="array"> <array> <body>Ahaaa</body> <created_at type="datetime">2009-08-14T15:56:40Z</created_at> <id type="integer">71</id> <place_id type="integer">51</place_id> <profile_id type="integer">1</profile_id> </array> </array> <array type="array"> <array> <caption></caption> <created_at type="datetime">2009-08-14T17:14:55Z</created_at> <geo_lat type="float">50.7727</geo_lat> <geo_long type="float">4.53766</geo_long> <id type="integer">20</id> <image>/Users/woutergo/Documents/workspace/myBuddyNetwork/public/ system/photo/image/20/14njk8w.jpg</image> <place_id type="integer">51</place_id> <profile_id type="integer">1</profile_id> <show_geo type="integer" nil="true"></show_geo> <updated_at type="datetime">2009-08-14T17:14:55Z</updated_at> </array> </array> </arrays> There must be another way.. Thank you On 14 aug, 19:07, Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Wouter wrote: > > Any idea how I can do that? How can i use that? > > @shouts = Shout.find(:all, :include => [:place, :profile]) > @photos = Photo.find(:all, :include => [:place, :profile]) > > You can also use a :joins in the model if you tie it all together > properly. This is just a very basic example. > > Test it out in the rails console then call the data back.. > > shouts = Shout.find(:all, :include => [:place, :profile]) > shouts.place > shouts.profile > etc... > > -- > Posted viahttp://www.ruby-forum.com/.
You can still just use one request, but you need to build your associations better. I''m not sure exactly what you have in each and every table but something you should consider here is not to over-normalize your db/tables too much. For instance, if one of those tables just contains one or two columns, does it have to be a separate table? Or, can combine it with another table? If you need to have separate foreign keys for specific areas of a table, you can look at self-referential joins. -- Posted via http://www.ruby-forum.com/.
Hey if you see at my example above: <array> <body>Ahaaa</body> <created_at type="datetime">2009-08-14T15:56:40Z</created_at> <id type="integer">71</id> <place_id type="integer">51</place_id> <profile_id type="integer">1</profile_id> </array> ==> SHOUT <array> <caption></caption> <created_at type="datetime">2009-08-14T17:14:55Z</created_at> <geo_lat type="float">50.7727</geo_lat> <geo_long type="float">4.53766</geo_long> <id type="integer">20</id> <image>/Users/woutergo/Documents/workspace/myBuddyNetwork/ public/ system/photo/image/20/14njk8w.jpg</image> <place_id type="integer">51</place_id> <profile_id type="integer">1</profile_id> <show_geo type="integer" nil="true"></show_geo> <updated_at type="datetime">2009-08-14T17:14:55Z</updated_at> </array> ==> PHOTO so in these 2 objects there is a profile_id and a place_id. I only need to have these 2 objects combined per place or per profile (sorted by profile_id or by place_id)! A place has photos and shouts and a profile has photos and shouts.. I am creating an android Application and for this i need to make one request with these 2 objects combined in 1 xml file. I hope someone can help me, really need to find this! Thank you for your effort! Wouter On 14 aug, 22:26, Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> You can still just use one request, but you need to build your > associations better. I''m not sure exactly what you have in each and > every table but something you should consider here is not to > over-normalize your db/tables too much. > > For instance, if one of those tables just contains one or two columns, > does it have to be a separate table? Or, can combine it with another > table? If you need to have separate foreign keys for specific areas of > a table, you can look at self-referential joins. > > -- > Posted viahttp://www.ruby-forum.com/.
2009/8/14 Alpha Blue <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > You can still just use one request, but you need to build your > associations better. I''m not sure exactly what you have in each and > every table but something you should consider here is not to > over-normalize your db/tables too much. > > For instance, if one of those tables just contains one or two columns, > does it have to be a separate table? Or, can combine it with another > table? If you need to have separate foreign keys for specific areas of > a table, you can look at self-referential joins. >It took me a little while to realise that it is not fetching the data that is the OPs problem but how to use to_xml to generate his xml in the way he wants. Colin
Colin Law wrote:> 2009/8/14 Alpha Blue <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: >> > It took me a little while to realise that it is not fetching the data > that is the OPs problem but how to use to_xml to generate his xml in > the way he wants. > > ColinThe problem is two fold: Controller def my_xml @shouts = Shout.find(:all, :include => [:place, :profile]) respond_to do |format| format.html format.xml { render :xml, :xml => @shouts.to_xml } end end View <ul> <% for shout in @shouts-%> <li> <%=h shout.something %>, <%=h shout.place.something %>, <%=h shout.profile.something %> </li> </ul> You use render to build the XML. However, you still need to work on associations so you can make use of includes/joins to make just one array.. -- Posted via http://www.ruby-forum.com/.
No sorry I dont need to make a view. I have this already for shouts and photos. I only need to find a way to make the corrent xml file like i posted already! Do i have to use XML builder to make the xml like i want? On Aug 14, 11:20 pm, Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Colin Law wrote: > > 2009/8/14 Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: > > > It took me a little while to realise that it is not fetching the data > > that is the OPs problem but how to use to_xml to generate his xml in > > the way he wants. > > > Colin > > The problem is two fold: > > Controller > > def my_xml > @shouts = Shout.find(:all, :include => [:place, :profile]) > respond_to do |format| > format.html > format.xml { render :xml, :xml => @shouts.to_xml } > end > end > > View > > <ul> > <% for shout in @shouts-%> > <li> > <%=h shout.something %>, <%=h shout.place.something %>, <%=h > shout.profile.something %> > </li> > </ul> > > You use render to build the XML. > > However, you still need to work on associations so you can make use of > includes/joins to make just one array.. > > -- > Posted viahttp://www.ruby-forum.com/.
Please has no one an idea? It must be possible with ruby on rails.. On 15 aug, 13:50, Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No sorry I dont need to make a view. > I have this already for shouts and photos. > > I only need to find a way to make the corrent xml file like i posted > already! > > Do i have to use XML builder to make the xml like i want? > > On Aug 14, 11:20 pm, Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Colin Law wrote: > > > 2009/8/14 Alpha Blue <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: > > > > It took me a little while to realise that it is not fetching the data > > > that is the OPs problem but how to use to_xml to generate his xml in > > > the way he wants. > > > > Colin > > > The problem is two fold: > > > Controller > > > def my_xml > > @shouts = Shout.find(:all, :include => [:place, :profile]) > > respond_to do |format| > > format.html > > format.xml { render :xml, :xml => @shouts.to_xml } > > end > > end > > > View > > > <ul> > > <% for shout in @shouts-%> > > <li> > > <%=h shout.something %>, <%=h shout.place.something %>, <%=h > > shout.profile.something %> > > </li> > > </ul> > > > You use render to build the XML. > > > However, you still need to work on associations so you can make use of > > includes/joins to make just one array.. > > > -- > > Posted viahttp://www.ruby-forum.com/. > >
2009/8/14 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Thank you for your answer! > >> @shouts = Shout.find(:all, :include => [:place, :profile]) >> @photos = Photo.find(:all, :include => [:place, :profile]) > > But with this i got 2 arrays and I need 1 array with all the photos > and shouts in it.. > and if i do @objects = [@shouts, @photos] and then @objects.to_xml, I > get the same as a few posts above: > > <?xml version="1.0" encoding="UTF-8"?> > <arrays type="array"> > <array type="array"> > <array> > <body>Ahaaa</body> > <created_at type="datetime">2009-08-14T15:56:40Z</created_at> > <id type="integer">71</id> > <place_id type="integer">51</place_id> > > <profile_id type="integer">1</profile_id> > </array> > </array> > <array type="array"> > <array> > <caption></caption> > <created_at type="datetime">2009-08-14T17:14:55Z</created_at> > <geo_lat type="float">50.7727</geo_lat> > > <geo_long type="float">4.53766</geo_long> > <id type="integer">20</id> > <image>/Users/woutergo/Documents/workspace/myBuddyNetwork/public/ > system/photo/image/20/14njk8w.jpg</image> > <place_id type="integer">51</place_id> > <profile_id type="integer">1</profile_id> > <show_geo type="integer" nil="true"></show_geo> > > <updated_at type="datetime">2009-08-14T17:14:55Z</updated_at> > </array> > </array> > </arrays> > > There must be another way.. Thank you >Have you tried providing some virtual members of your model that make that data accessible in the way that you want, then using to_xml and specifying only the virtual members to be used? I don''t know if this will work but it is worth a try. Colin
On 17 aug, 22:05, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > Thank you for your answer! > > >> @shouts = Shout.find(:all, :include => [:place, :profile]) > >> @photos = Photo.find(:all, :include => [:place, :profile]) > > > But with this i got 2 arrays and I need 1 array with all the photos > > and shouts in it.. > > and if i do @objects = [@shouts, @photos] and then @objects.to_xml, I > > get the same as a few posts above: > > > <?xml version="1.0" encoding="UTF-8"?> > > <arrays type="array"> > > <array type="array"> > > <array> > > <body>Ahaaa</body> > > <created_at type="datetime">2009-08-14T15:56:40Z</created_at> > > <id type="integer">71</id> > > <place_id type="integer">51</place_id> > > > <profile_id type="integer">1</profile_id> > > </array> > > </array> > > <array type="array"> > > <array> > > <caption></caption> > > <created_at type="datetime">2009-08-14T17:14:55Z</created_at> > > <geo_lat type="float">50.7727</geo_lat> > > > <geo_long type="float">4.53766</geo_long> > > <id type="integer">20</id> > > <image>/Users/woutergo/Documents/workspace/myBuddyNetwork/public/ > > system/photo/image/20/14njk8w.jpg</image> > > <place_id type="integer">51</place_id> > > <profile_id type="integer">1</profile_id> > > <show_geo type="integer" nil="true"></show_geo> > > > <updated_at type="datetime">2009-08-14T17:14:55Z</updated_at> > > </array> > > </array> > > </arrays> > > > There must be another way.. Thank you > > Have you tried providing some virtual members of your model that make > that data accessible in the way that you want, then using to_xml and > specifying only the virtual members to be used? I don''t know if this > will work but it is worth a try. > > ColinHey, No I havent tried this, how do i have to do this? Can you give me an example? Thank you Wouter
On Aug 17, 9:05 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > Have you tried providing some virtual members of your model that make > that data accessible in the way that you want, then using to_xml and > specifying only the virtual members to be used? I don''t know if this > will work but it is worth a try.If that doesn''t work out then created a xml builder template isn''t hard. Fred
2009/8/17 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > > On 17 aug, 22:05, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> >> >> >> > Thank you for your answer! >> >> >> @shouts = Shout.find(:all, :include => [:place, :profile]) >> >> @photos = Photo.find(:all, :include => [:place, :profile]) >> >> > But with this i got 2 arrays and I need 1 array with all the photos >> > and shouts in it.. >> > and if i do @objects = [@shouts, @photos] and then @objects.to_xml, I >> > get the same as a few posts above: >> >> > <?xml version="1.0" encoding="UTF-8"?> >> > <arrays type="array"> >> > <array type="array"> >> > <array> >> > <body>Ahaaa</body> >> > <created_at type="datetime">2009-08-14T15:56:40Z</created_at> >> > <id type="integer">71</id> >> > <place_id type="integer">51</place_id> >> >> > <profile_id type="integer">1</profile_id> >> > </array> >> > </array> >> > <array type="array"> >> > <array> >> > <caption></caption> >> > <created_at type="datetime">2009-08-14T17:14:55Z</created_at> >> > <geo_lat type="float">50.7727</geo_lat> >> >> > <geo_long type="float">4.53766</geo_long> >> > <id type="integer">20</id> >> > <image>/Users/woutergo/Documents/workspace/myBuddyNetwork/public/ >> > system/photo/image/20/14njk8w.jpg</image> >> > <place_id type="integer">51</place_id> >> > <profile_id type="integer">1</profile_id> >> > <show_geo type="integer" nil="true"></show_geo> >> >> > <updated_at type="datetime">2009-08-14T17:14:55Z</updated_at> >> > </array> >> > </array> >> > </arrays> >> >> > There must be another way.. Thank you >> >> Have you tried providing some virtual members of your model that make >> that data accessible in the way that you want, then using to_xml and >> specifying only the virtual members to be used? I don''t know if this >> will work but it is worth a try. >> >> Colin > > Hey, > > No I havent tried this, how do i have to do this? Can you give me an > example? >Which part do you have the problem with? Colin
And can I create an xml builder template for the xml i want? And if yes, can you give me an example please.. Wouter On 17 aug, 22:11, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Aug 17, 9:05 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > Have you tried providing some virtual members of your model that make > > that data accessible in the way that you want, then using to_xml and > > specifying only the virtual members to be used? I don''t know if this > > will work but it is worth a try. > > If that doesn''t work out then created a xml builder template isn''t > hard. > > Fred
2009/8/17 Wouter <woutergo71-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > And can I create an xml builder template for the xml i want? And if > yes, can you give me an example please..Can I ask how much research (google etc) you did on xml builder templates before asking this question, you can''t expect people to jump about providing examples when you have not even tried to work it out for yourself. Fred, sorry for jumping in with this, exasperation is growing. Colin> > Wouter > > On 17 aug, 22:11, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On Aug 17, 9:05 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> > 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> > Have you tried providing some virtual members of your model that make >> > that data accessible in the way that you want, then using to_xml and >> > specifying only the virtual members to be used? I don''t know if this >> > will work but it is worth a try. >> >> If that doesn''t work out then created a xml builder template isn''t >> hard. >> >> Fred > > >
On Aug 17, 9:14 pm, Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> And can I create an xml builder template for the xml i want? And if > yes, can you give me an example please.. >you can create arbitrary xml with builder. examples on the builder homepage Fred> Wouter > > On 17 aug, 22:11, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Aug 17, 9:05 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > 2009/8/14 Wouter <wouterg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > Have you tried providing some virtual members of your model that make > > > that data accessible in the way that you want, then using to_xml and > > > specifying only the virtual members to be used? I don''t know if this > > > will work but it is worth a try. > > > If that doesn''t work out then created a xml builder template isn''t > > hard. > > > Fred