I have an index page showing a table of network hosts with IP addresses, roles, hostname etc. Is it trivial to render that page to the browser as a csv file instead of html and link to that rendering on the index page? How is that done? Is there a nice rails csv rendering for dummies page? Thanks in advance, -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
There is a nice gem for generating CSV files called FasterCSV. I would start with that - it has decent instructions. If you need to generate a large (e.g. thousands of lines) CSV file you may need to move to more advanced tricks for generating the file but start with that gem and see if that gets you going. --Michael On May 21, 3:29 pm, chewmanfoo <chewman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have an index page showing a table of network hosts with IP > addresses, roles, hostname etc. Is it trivial to render that page to > the browser as a csv file instead of html and link to that rendering > on the index page? How is that done? Is there a nice rails csv > rendering for dummies page? > > Thanks in advance, > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
chewmanfoo wrote:> I have an index page showing a table of network hosts with IP > addresses, roles, hostname etc. Is it trivial to render that page to > the browser as a csv file instead of html and link to that rendering > on the index page?Yes.> How is that done?The same way as you would for HTML -- specify a template to render. Check out respond_to for more.> Is there a nice rails csv > rendering for dummies page?You don''t need one.> > Thanks in advance,Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.