Class: Spree::Admin::ContentsController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/spree/admin/contents_controller.rb

Instance Method Summary collapse

Instance Method Details

#update_positionsObject



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

def update_positions
  @page = parent
  params[:positions].each do |id, index|
    @page.contents.update_all(['position=?', index], ['id=?', id])
  end
  respond_to do |format|
    format.html { redirect_to admin_page_contents_url(@page) }
    format.js  { render :text => 'Ok' }
  end
end