mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Cancel invoices through admin
This commit is contained in:
parent
c7e02373fa
commit
1f2f483e34
3 changed files with 18 additions and 2 deletions
|
@ -10,4 +10,14 @@ class Admin::InvoicesController < AdminController
|
|||
def show
|
||||
@invoice = Invoice.find(params[:id])
|
||||
end
|
||||
|
||||
def cancel
|
||||
if @invoice.cancel
|
||||
flash[:notice] = t('record_updated')
|
||||
redirect_to([:admin, @invoice])
|
||||
else
|
||||
flash.now[:alert] = t('failed_to_update_record')
|
||||
render :show
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue