Module: Nivo::ManageSlides::ClassMethods

Defined in:
lib/nivo/manage_slides.rb

Instance Method Summary collapse

Instance Method Details

#sort(new_order = {}) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/nivo/manage_slides.rb', line 6

def sort(new_order={})
  new_order.to_a
  new_order.each do |order|
    slide = self.find(order[1])
    slide.position = order[0]
    slide.save
  end
end