Sha256: 1090b1f64b3838987293316dfebfb9c93da025e1acb07da95e304c9dbe33c177
Contents?: true
Size: 332 Bytes
Versions: 25
Compression:
Stored size: 332 Bytes
Contents
class GalleryPhotos attr_reader :parent attr_reader :params def initialize(parent, params) @parent = parent @params = params end 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 end
Version data entries
25 entries across 25 versions & 1 rubygems