On Jan 15, 6:15 am, Michael Linfield <[email protected]> wrote: > Hey everyone, > > I've got a basic setup via an apache2 server, virtualhost ect. At the > moment I'm just trying to use the send_file function of rails > (actionpack I believe?) but it continues to error out. Here is the > breakdown: > > #Controller# > > class Misc < ApplicationController > > def stuff > send_file("#{RAILS_ROOT}/downloads/test.txt") > end > > end > > #View# > > <% a = Misc.new %> > <p><%= a.stuff %></p>
This looks a little weird - from inside the view you're trying to create a new instance of a controller ? This is probably failing because you haven't initialized the controller properly. Why not call send_file from the appropriate controller action ? Fred
-- 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.

