Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

367
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda