I have a small rails application in which if the environment is development, I am storing images locally. I can see that the image is successfully being uploaded but for some reason when I use the relative path of that image in the src attribute of my img tag, the image breaks and shows nothing.
The file I upload is stored in directory folder as below
projectName
-tmp
-uploads
-files
-file
-50
-testImage.png
There are several folders in the project where tmp is one of those folders. Now I want to access the testImage in the src attribute of img tag. I have tried
<img src="/uploads/files/file/50/testImage.png" />
Also,
<img src="/tmp/uploads/files/file/50/testImage.png" />
But in both cases I get the image as nil.
Domain is localhost:3000 and img tag resides in a js file. Any help would be appreciated.