Class: Accountability::PaymentsController

Inherits:
AccountabilityController show all
Defined in:
app/controllers/accountability/payments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/accountability/payments_controller.rb', line 5

def create
  @payment = @account.payments.new(payment_params)

  if @payment.save
    redirect_to (@account), notice: 'Payment was completed successfully'
  else
    render json: { status: :error, errors: @payment.errors }
  end
end