child images tag adding and deleting updated.
This commit is contained in:
parent
6d8698af63
commit
131dd3fea8
|
@ -195,8 +195,18 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||||
|
debugger
|
||||||
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
|
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
|
||||||
# tagsToAdd will contain all tag ids which ve to be added in tall gallery_images
|
# tagsToAdd will contain all tag ids which ve to be added in tall gallery_images
|
||||||
|
@images = GalleryImage.all
|
||||||
|
@images.each do |image|
|
||||||
|
image.tagged_ids.concat(tagsToAdd)
|
||||||
|
tagsToDestroy.each do |tag|
|
||||||
|
if image.tagged_ids.include?tag
|
||||||
|
image.tagged_ids.delete(tag)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
image.save
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue