Hi -

I want to enable the user to generate a report based on the database
used by the application. I have a few related questions:

1. Assuming my script is called 'create_report.rb' and stored under
/lib/tasks, how do I execute it from my controller once the user clicked
the link? I read that 'send_file' is probably what I want.

2. ActiveRecord is great (statement), and I want to use it in this
script. Do I need to require 'activerecord' or anything in the actual
file? I would like to use AR much like I do in my views (@users =
User.find(:all), user.full_name, etc.) - Does it just work or do I need
to somehow load the existing models to memory.

3. where is the logical place on the server to store files I create (if
there is one)? I was thinking /public/files/ or something, or even
outside my application root.

3. for the sake of example, I want to return a csv file containing all
users and their birthdays: http://pastie.org/410902

It's very incomplete, but I'm hoping someone can point me in the right
direction... thanks.
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to