mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Interface for manual binding
This commit is contained in:
parent
adf321bafa
commit
ccb44fa3b9
8 changed files with 189 additions and 23 deletions
|
@ -1,5 +1,29 @@
|
|||
class Admin::BankTransactionsController < AdminController
|
||||
load_and_authorize_resource
|
||||
|
||||
def show; end
|
||||
def update
|
||||
if @bank_transaction.update(bank_transaction_params)
|
||||
flash[:notice] = I18n.t('record_updated')
|
||||
redirect_to [:admin, @bank_transaction]
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_update_record')
|
||||
render 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
def bind
|
||||
if @bank_transaction.bind_invoice(params[:invoice_id])
|
||||
flash[:notice] = I18n.t('record_created')
|
||||
redirect_to [:admin, @bank_transaction]
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_create_record')
|
||||
render 'show'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def bank_transaction_params
|
||||
params.require(:bank_transaction).permit(:description, :sum, :reference_no)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue