Class: SolidusAdmin::OptionTypesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- SolidusAdmin::OptionTypesController
- Includes:
- ControllerHelpers::Search
- Defined in:
- app/controllers/solidus_admin/option_types_controller.rb
Instance Method Summary collapse
Methods included from ComponentsHelper
Instance Method Details
#destroy ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/controllers/solidus_admin/option_types_controller.rb', line 30 def destroy @option_types = Spree::OptionType.where(id: params[:id]) Spree::OptionType.transaction { @option_types.destroy_all } flash[:notice] = t('.success') redirect_back_or_to option_types_path, status: :see_other end |
#index ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/solidus_admin/option_types_controller.rb', line 9 def index option_types = apply_search_to( Spree::OptionType.all, param: :q, ) set_page_and_extract_portion_from(option_types) respond_to do |format| format.html { render component('option_types/index').new(page: @page) } end end |
#move ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/solidus_admin/option_types_controller.rb', line 22 def move @option_type.insert_at(params[:position].to_i) respond_to do |format| format.js { head :no_content } end end |