mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Added possibilty to delete pricelist from admin #2380
This commit is contained in:
parent
b0296bd33e
commit
f5b5c1fb25
3 changed files with 10 additions and 2 deletions
|
@ -32,6 +32,11 @@ class Admin::PricelistsController < AdminController
|
|||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@pricelist.destroy
|
||||
redirect_to admin_pricelists_url
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_pricelist
|
||||
|
|
|
@ -29,5 +29,7 @@
|
|||
%hr
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= button_tag(t(:save), class: 'btn btn-primary')
|
||||
|
||||
= button_tag(t(:save), class: 'btn btn-warning')
|
||||
- if !f.object.new_record? && can?(:delete, f.object)
|
||||
= link_to t(:delete), admin_pricelist_path(f.object),
|
||||
method: :delete, data: { confirm: t(:are_you_sure_destroy) }, class: 'btn btn-danger'
|
||||
|
|
|
@ -291,6 +291,7 @@ en:
|
|||
description: 'Description'
|
||||
delete: 'Delete'
|
||||
are_you_sure: 'Are you sure?'
|
||||
are_you_sure_destroy: 'You are going to delete, are you sure?'
|
||||
back: 'Back'
|
||||
new_domain: 'New domain'
|
||||
registrar_name: 'Registrar name'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue