Advertisement
meoooh

Untitled

Aug 21st, 2013
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.26 KB | None | 0 0
  1. class ClientsController < ApplicationController
  2.   def download_pdf
  3.     client = Client.find(params[:id])
  4.     send_file("#{Rails.root}/files/clients/#{client.id}.pdf",
  5.               filename: "#{client.name}.pdf",
  6.               type: "application/pdf")
  7.   end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement