Fix widget when album images less then 9 and fix update method redirect path
This commit is contained in:
parent
db67704a88
commit
60c4901070
|
@ -192,7 +192,7 @@ class Admin::GalleriesController < OrbitAdminController
|
|||
end
|
||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
@album.update_attributes(album_params)
|
||||
redirect_to admin_gallery_path(@album)
|
||||
redirect_to "/admin/galleries/"+@album.id.to_s
|
||||
end
|
||||
|
||||
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
|
|
|
@ -34,7 +34,7 @@ class GalleriesController < ApplicationController
|
|||
params = OrbitHelper.params
|
||||
|
||||
images = []
|
||||
while images.count < 9
|
||||
while images.count < 9 and images.count < AlbumImage.count
|
||||
albums.each do |album|
|
||||
img = album.album_images.sample
|
||||
if !images.include?(img) && img != nil
|
||||
|
|
Loading…
Reference in New Issue