alum tag save fix

This commit is contained in:
Harry Bomrah 2013-11-26 21:26:50 +08:00 committed by saurabhbhatia
parent dc7710cc65
commit 6baec3ce6a
1 changed files with 2 additions and 1 deletions

View File

@ -189,7 +189,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
@album = Album.find(params[:id])
tagsToDestroy = []
tagsToAdd = []
new_tags = params[:album][:tag_ids]
new_tags = params[:album][:tag_ids] || []
old_tags = @album.tagged_ids
old_tags.each do |tag|
if !new_tags.include?(tag)
@ -204,6 +204,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
end
end
update_children_image_tag(tagsToDestroy,tagsToAdd)
params[:album][:tag_ids] = params[:album][:tag_ids] || []
@album.update_attributes(params[:album])
redirect_to panel_gallery_back_end_album_path(@album)
end