Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

364
Views
Unable to get relative path from root to img src in rails application

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.

enter image description here

Domain is localhost:3000 and img tag resides in a js file. Any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!