Hi, I have built a simple Camping application which indexes an ODBC datasource using Ferret on startup, then accepts search strings and renders the resulting hit list in HTML, and it works quite nicely. The next step was to alternately render the list in XML for consumption by another application. In Rails, I would simply use Builder in the view to get the job done, and so I did the same in Camping ... Index_xml is my view: def index_xml @headers[''Content-Type''] = ''text/xml'' xml = Builder::XmlMarkup.new(:target => self) xml.instruct! xml.results do # # more xml builder stuff here # end end This works great! After hacking this together, it occurred to me that Camping/Markaby might have a better way, hence this email. Any comments/pointers welcome, Thanks Neville
On May 31, 2006, at 5:36 AM, Neville Burnell wrote:> > This works great! After hacking this together, it occurred to me that > Camping/Markaby might have a better way, hence this email.There''s no other way to do it that I know of.
dismiss/correct me if i''m wrong/mistaken but camping uses activerecord, can''t you use to_xml ? On 5/31/06, Manfred Stienstra <manfred at gmail.com> wrote:> > On May 31, 2006, at 5:36 AM, Neville Burnell wrote: > > > > This works great! After hacking this together, it occurred to me that > > Camping/Markaby might have a better way, hence this email. > > There''s no other way to do it that I know of. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Rodney http://www.pinupgeek.com http://www.dutchrailers.org
I''m getting the search results directly from Ferret, so ActiveRecord is not in the mix -----Original Message----- From: camping-list-bounces at rubyforge.org [mailto:camping-list-bounces at rubyforge.org] On Behalf Of Rodney Ramdas Sent: Thursday, 1 June 2006 5:33 AM To: camping-list at rubyforge.org Subject: Re: Camping and Builder and XML dismiss/correct me if i''m wrong/mistaken but camping uses activerecord, can''t you use to_xml ? On 5/31/06, Manfred Stienstra <manfred at gmail.com> wrote:> > On May 31, 2006, at 5:36 AM, Neville Burnell wrote: > > > > This works great! After hacking this together, it occurred to me > > that Camping/Markaby might have a better way, hence this email. > > There''s no other way to do it that I know of. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Rodney http://www.pinupgeek.com http://www.dutchrailers.org _______________________________________________ Camping-list mailing list Camping-list at rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list