hi all, is there any method/way to generate a csv from an object directly? e.g. @object.to_csv that will create a csv file with whatever data that object holds? the object that i have is a parsed xml response like @report = parsed xml. but i''m not able to send it to csv as number of columns,rows,headings are not fixed. this object holds report data. thanks in advance. -Dhaval -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Have you looked a Comma, http://redartisan.com/2009/3/10/comma-intro ? Eifion http://asciicasts.com Twitter: @eifion On 19 Mar 2009, at 17:55, Dhaval Phansalkar wrote:> > hi all, > > is there any method/way to generate a csv from an object directly? > e.g. > @object.to_csv that will create a csv file with whatever data that > object holds? > > the object that i have is a parsed xml response like @report = parsed > xml. but i''m not able to send it to csv as number of > columns,rows,headings are not fixed. this object holds report data. > thanks in advance. > > -Dhaval > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruports is pretty slick: http://rubyreports.org/ On Mar 19, 1:55 pm, Dhaval Phansalkar <rails-mailing-l...@andreas- s.net> wrote:> hi all, > > is there any method/way to generate a csv from an object directly? e.g. > @object.to_csv that will create a csv file with whatever data that > object holds? > > the object that i have is a parsed xml response like @report = parsed > xml. but i''m not able to send it to csv as number of > columns,rows,headings are not fixed. this object holds report data. > thanks in advance. > > -Dhaval > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---