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

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 S.
http://jystewart.net/process/

Also you might find fastercsv useful:

http://fastercsv.rubyforge.org/

thanks, gents, will check it out.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs