send_file

Hi,

I have a fyle object which is using paperclip plugin to store filz.
I want of ofcourse download the file from the application.
Now the problem I face is my application is not being able to find the
function send_file

1. I have actionpack in ruby gems and I can see the send_file function
in it
2. I have done require 'actionpack' in the file where i m calling
send_file
3. Stil i m getting error - undefined method `send_file'

Note: I have presently defined send_file in Fyle model.
  def download
    send_file filz.url, :type=> filz_content_type
  end

I am presently on Mongrel

Does any one know about send_file method and how and where should it
be used?

Hi,

I have a fyle object which is using paperclip plugin to store filz.
I want of ofcourse download the file from the application.
Now the problem I face is my application is not being able to find the
function send_file

send_file is a controller method, not a model method.

Fred

Well.........
then how do I use it?

I dont wanna define a view file for it
  def self.download(fileobj)
    send_file fileobj.filz.url, :type=>
fileobj.filz_content_type, :x_sendfile=>true
  end

In such a case, it does not find download method from a view file on
when I call it as Fyle.download(...)