class GalleryPhotos
Attributes
params[R]
parent[R]
Public Class Methods
new(parent, params)
click to toggle source
# File lib/components/gallery_photos.rb, line 5 def initialize(parent, params) @parent = parent @params = params end
Public Instance Methods
sort_gallery_photos_for_parent()
click to toggle source
# File lib/components/gallery_photos.rb, line 10 def sort_gallery_photos_for_parent params[:gallery_photos].each_with_index do |id, index| parent.gallery_photos.find(id).update_attributes(order: index+1) end end