Reputation: 4706
I put this in my Rails controller
send_file('/public/images/rails.png')
but it gives error
Cannot read file /public/images/rails.png
even though the file is there. How can I fix it?
Upvotes: 1
Views: 885
Reputation: 23713
Try doing this:
send_file("#{Rails.root}/public/images/rails.png")
Upvotes: 3