Displaying 1 result from an estimated 1 matches for "blogattach".
2014 Mar 26
0
Heroku | Rails 4 | Ruby 2.0 - send_file not presenting file for download in the browser
...("#{Rails.root}/public/blog_attachments/#{file.document_file_name}",'wb') do |f|
f.write HTTParty.get(file.document.url).parsed_response
end
end
# Use callbacks to share common setup or constraints between actions.
def set_blog_attachment
@blog_attachment = BlogAttachment.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def blog_attachment_params
params[:blog_attachment]
end
app/views/blogs/show.html.erb
<% for attachment in @blog.blog_attachments %>
<%= link_to attachment.docume...