nephish
2007-May-21 03:27 UTC
best way to generate a text or csv file for user to download
lo there all, i need to be able to generate a link to a dynamically created text or csv file when a user hits a link or button ( don''t know yet ). But since the file is going to be generated on the fly, i need an action to actually create it. Does anyone have an idea of how the best way to do this would be? 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 rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
James Stewart
2007-May-21 04:32 UTC
Re: best way to generate a text or csv file for user to download
On May 20, 2007, at 10:27 PM, nephish wrote:> i need to be able to generate a link to a dynamically created text or > csv file when a user hits a link or button ( don''t know yet ). But > since the file is going to be generated on the fly, i need an action > to actually create it. > > Does anyone have an idea of how the best way to do this would be?You''ll probably want to take a look at the send_file method: http://rails.rubyonrails.org/classes/ActionController/ Streaming.html#M000091 James. -- James Stewart http://jystewart.net/process/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dasil003
2007-May-21 05:44 UTC
Re: best way to generate a text or csv file for user to download
Also you might find fastercsv useful: http://fastercsv.rubyforge.org/ On May 20, 10:32 pm, James Stewart <jystew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 20, 2007, at 10:27 PM, nephish wrote: > > > i need to be able to generate a link to a dynamically created text or > > csv file when a user hits a link or button ( don''t know yet ). But > > since the file is going to be generated on the fly, i need an action > > to actually create it. > > > Does anyone have an idea of how the best way to do this would be? > > You''ll probably want to take a look at the send_file method: > > http://rails.rubyonrails.org/classes/ActionController/ > Streaming.html#M000091 > > James. > > -- > James Stewarthttp://jystewart.net/process/--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
nephish
2007-May-21 10:12 UTC
Re: best way to generate a text or csv file for user to download
thanks, gents, will check it out. On May 21, 12:44 am, dasil003 <gabrie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Also you might find fastercsv useful: > > http://fastercsv.rubyforge.org/ > > On May 20, 10:32 pm, James Stewart <jystew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On May 20, 2007, at 10:27 PM, nephish wrote: > > > > i need to be able to generate a link to a dynamically created text or > > > csv file when a user hits a link or button ( don''t know yet ). But > > > since the file is going to be generated on the fly, i need an action > > > to actually create it. > > > > Does anyone have an idea of how the best way to do this would be? > > > You''ll probably want to take a look at the send_file method: > > >http://rails.rubyonrails.org/classes/ActionController/ > > Streaming.html#M000091 > > > James. > > > -- > > James Stewarthttp://jystewart.net/process/--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---