mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 14:06:21 +02:00
add option to delete auction record
This commit is contained in:
parent
487cbb1774
commit
75df2212da
5 changed files with 30 additions and 3 deletions
|
@ -44,7 +44,7 @@ module Admin
|
|||
|
||||
if auction.save
|
||||
reserved_domain = auction.domain if remove_from_reserved(auction)
|
||||
flash[:notice] = "Auction #{params[:domain]} created.
|
||||
flash[:notice] = "Auction #{params[:domain]} created.
|
||||
#{reserved_domain.present? ? 'These domain will be removed from reserved list: ' + reserved_domain : ' '}"
|
||||
else
|
||||
flash[:alert] = 'Something goes wrong'
|
||||
|
@ -53,6 +53,18 @@ module Admin
|
|||
redirect_to admin_auctions_path
|
||||
end
|
||||
|
||||
def destroy
|
||||
auction = Auction.find(params[:id])
|
||||
|
||||
if auction.destroy
|
||||
flash[:notice] = I18n.t('record_deleted')
|
||||
else
|
||||
flash.now[:alert] = I18n.t('failed_to_delete_record')
|
||||
end
|
||||
|
||||
redirect_to admin_auctions_path
|
||||
end
|
||||
|
||||
def upload_spreadsheet
|
||||
if params[:q].nil?
|
||||
flash[:alert] = 'No file upload! Look at the left of upload button!'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue