download multiples files in one request
- by alexperto
I don't know if it is posible, but I'd like to download a group of pdf's in only one request
this is the way I download a particular invoice:
def show
@invoice = Invoice.find_by_invoice_hash params[:hash]
respond_to do |format|
format.html
format.xml do
send_data File.read( @invoice.xml_path ), type: 'text/xml', filename: "invoice_#{ @invoice.id }.xml", disposition: 'attachment'
end
format.pdf do
render :pdf => @invoice.hash,
layout: 'pdf',
footer: {
right: "printed at: #{Date.today}"
}
end
end
end
What do you suggest me to do?