Class: Blog::Admin::PostImagesController

Inherits:
Admin::ResourceController
  • Object
show all
Defined in:
app/controllers/blog/admin/post_images_controller.rb

Instance Method Summary collapse

Instance Method Details

#update_positionsObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/blog/admin/post_images_controller.rb', line 9

def update_positions
  params[:positions].each do |id, index|
    PostImage.update_all(['position=?', index], ['id=?', id])
  end

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