Class: Admin::ImageRotatorImagesController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::ImageRotatorImagesController
- Defined in:
- app/controllers/admin/image_rotator_images_controller.rb
Instance Method Summary collapse
Instance Method Details
#update_positions ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/admin/image_rotator_images_controller.rb', line 10 def update_positions 0.upto((newlist ||= params[:ul]).length - 1) do |index| hash = newlist[index.to_s] moved_item_id = hash['id'].split(/image_rotator_image_/) image = ImageRotatorImage.find_by_id(moved_item_id) image.insert_at(index + 1) end render :nothing => true end |