Class: Spree::Admin::OptionTypesController

Inherits:
ResourceController show all
Defined in:
app/controllers/spree/admin/option_types_controller.rb

Instance Method Summary collapse

Methods inherited from ResourceController

belongs_to, #create, #destroy, #edit, #new, #update, #update_positions

Methods included from SetsUserLanguageLocaleKey

#set_user_language_locale_key

Instance Method Details

#update_values_positionsObject



8
9
10
11
12
13
14
15
16
# File 'app/controllers/spree/admin/option_types_controller.rb', line 8

def update_values_positions
  params[:positions].each do |id, index|
    Spree::OptionValue.where(id:).update_all(position: index)
  end

  respond_to do |format|
    format.js { head :no_content }
  end
end