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

100
Vistas
Allow users to download file from S3 - Rails

I have PDF's stored on S3. Uploading them with Carrierwave works great. But how do I allow users to simple click a link to allow them to download the stored file onto their local machine? Here is my current attempt that is not working.

Controller:

def download
    article = Article.find_by(id: params[:id])

    data = open("#{article.file}")
    send_data data, filename: "#{article.file}"
end

View:

<td><%= link_to "Download File", download_article_path(article) %></td>

This isn't giving an error but it's also not download the file onto my machine. Any help would be great thanks!

about 4 years ago · Santiago Trujillo
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