mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update payments_controller.rb
This commit is contained in:
@@ -27,13 +27,14 @@ class PaymentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@customer = Customer.find_by_id(params[:customer_id])
|
@payment = Payment.new(params[:payment])
|
||||||
if @customer
|
if @payment.save
|
||||||
# TODO things
|
flash[:notice] = "Payment Saved"
|
||||||
|
redirect_to Customer.find_by_id(@payment.customer_id)
|
||||||
else
|
else
|
||||||
flash[:error] = @customer.errors.full_messages.to_sentence
|
flash[:error] = @payment.errors.full_messages.to_sentence
|
||||||
redirect_to new_payment_path
|
redirect_to new_customer_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user