Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. def download
  2. article = Article.find_by(id: params[:id])
  3.  
  4. data = open("#{article.file}")
  5. send_data data, filename: "#{article.file}"
  6. end
  7.  
  8. <td><%= link_to "Download File", download_article_path(article) %></td>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement