Class: Spree::Admin::Taxons::AttachmentController
- Inherits:
-
BaseController
- Object
- BaseController
- BaseController
- Spree::Admin::Taxons::AttachmentController
show all
- Defined in:
- app/controllers/spree/admin/taxons/attachment_controller.rb
Instance Method Summary
collapse
#set_user_language_locale_key
Instance Method Details
#destroy ⇒ Object
7
8
9
10
11
12
13
14
15
16
|
# File 'app/controllers/spree/admin/taxons/attachment_controller.rb', line 7
def destroy
taxonomy = Spree::Taxonomy.find(params[:taxonomy_id])
taxon = taxonomy.taxons.find(params[:taxon_id])
if taxon.destroy_attachment(params[:attachment_definition])
flash[:success] = t('spree.successfully_removed', resource: params[:attachment_definition].titleize)
else
flash[:error] = t('spree.taxon_attachment_removal_error')
end
redirect_to edit_admin_taxonomy_taxon_path(taxonomy, taxon.id)
end
|