how to display the image, which stored outside from the project directory?
Is there a simple way to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I see two ways :
http://yourapp.com/images/serving files from a specific dir. In rails, display the image with a traditionnalimage_tagExample with Nginx :
If you can’t access your server settings, you can serve an image file from a controller action with
send_fileIn a controller :
In
config/routes.rbThen when you access this action (via the route you defined in
config/routes.rb), you have the image. So in your view you do a traditionnalimage_tagwith this URL :