alum tag save fix
This commit is contained in:
parent
dc7710cc65
commit
6baec3ce6a
|
@ -189,7 +189,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
@album = Album.find(params[:id])
|
@album = Album.find(params[:id])
|
||||||
tagsToDestroy = []
|
tagsToDestroy = []
|
||||||
tagsToAdd = []
|
tagsToAdd = []
|
||||||
new_tags = params[:album][:tag_ids]
|
new_tags = params[:album][:tag_ids] || []
|
||||||
old_tags = @album.tagged_ids
|
old_tags = @album.tagged_ids
|
||||||
old_tags.each do |tag|
|
old_tags.each do |tag|
|
||||||
if !new_tags.include?(tag)
|
if !new_tags.include?(tag)
|
||||||
|
@ -204,6 +204,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||||
|
params[:album][:tag_ids] = params[:album][:tag_ids] || []
|
||||||
@album.update_attributes(params[:album])
|
@album.update_attributes(params[:album])
|
||||||
redirect_to panel_gallery_back_end_album_path(@album)
|
redirect_to panel_gallery_back_end_album_path(@album)
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue