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.
def download
article = Article.find_by(id: params[:id])
data = open("#{article.file}")
send_data data, filename: "#{article.file}"
end
<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!