Class: SolidusAdmin::ZonesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- SolidusAdmin::ZonesController
- Includes:
- ControllerHelpers::Search
- Defined in:
- app/controllers/solidus_admin/zones_controller.rb
Instance Method Summary collapse
Methods included from ComponentsHelper
Instance Method Details
#destroy ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/controllers/solidus_admin/zones_controller.rb', line 20 def destroy @zones = Spree::Zone.where(id: params[:id]) Spree::Zone.transaction { @zones.destroy_all } flash[:notice] = t('.success') redirect_back_or_to zones_path, status: :see_other end |
#index ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/solidus_admin/zones_controller.rb', line 7 def index zones = apply_search_to( Spree::Zone.order(id: :desc), param: :q ) set_page_and_extract_portion_from(zones) respond_to do |format| format.html { render component('zones/index').new(page: @page) } end end |