Class: SolidusAdmin::TaxRatesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- SolidusAdmin::TaxRatesController
- Includes:
- ControllerHelpers::Search
- Defined in:
- app/controllers/solidus_admin/tax_rates_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/tax_rates_controller.rb', line 20 def destroy @tax_rates = Spree::TaxRate.where(id: params[:id]) Spree::TaxRate.transaction { @tax_rates.destroy_all } flash[:notice] = t('.success') redirect_back_or_to tax_rates_path, status: :see_other end |
#index ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/solidus_admin/tax_rates_controller.rb', line 7 def index tax_rates = apply_search_to( Spree::TaxRate.order(created_at: :desc, id: :desc), param: :q, ) set_page_and_extract_portion_from(tax_rates) respond_to do |format| format.html { render component('tax_rates/index').new(page: @page) } end end |