Class: Spree::Admin::ImagesController

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

Instance Method Summary collapse

Methods inherited from ResourceController

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

Methods included from Core::ControllerHelpers

included

Instance Method Details

#update_positionsObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/spree/admin/images_controller.rb', line 10

def update_positions
  params[:positions].each do |id, index|
    Image.where(:id => id).update_all(:position => index)
  end

  respond_to do |format|
    format.js  { render :text => 'Ok' }
  end
end