sysmocom_dhl/app/controllers/admin/shipments_controller_decora...

12 lines
410 B
Ruby

Admin::ShipmentsController.class_eval do
def dhllabel
load_shipment
name = '%s_dhllabel.csv' % [@order.number]
headers["Content-type"] = "text/plain"
headers["Cache-Control"] = "no-cache, max-age=0, must-revalidate"
headers["Pragma"] = "no-cache"
headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
headers["Content-Disposition"] = "attachment; filename=\"%s\"" % name
end
end