mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-26 20:54:21 +01:00
19 lines
515 B
Ruby
19 lines
515 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# API Controller for resources of PaymentSchedule
|
||
|
class API::PaymentSchedulesController < API::ApiController
|
||
|
before_action :authenticate_user!
|
||
|
before_action :set_payment_schedule, only: %i[download]
|
||
|
|
||
|
def download
|
||
|
authorize @payment_schedule
|
||
|
# TODO, send_file File.join(Rails.root, @payment_schedule.file), type: 'application/pdf', disposition: 'attachment'
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def set_payment_schedule
|
||
|
@payment_schedule = PaymentSchedule.find(params[:id])
|
||
|
end
|
||
|
end
|