diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index e69bd50a..2499d08f 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -1,7 +1,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController include AdminHelper - before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_img_json] + before_filter :force_order_for_user, :except => [:index,:get_album_json,:get_imgs_json] def index if is_manager? || is_admin? || is_sub_manager? @@ -128,14 +128,14 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController album_cover_file: "http://#{request.host_with_port}#{album.cover_path}", album_name: album.name, album_tag_names: tag_names, - album_link:"http://#{request.host_with_port}" + album_link:"http://#{request.host_with_port}#{panel_gallery_back_end_album_get_imgs_json_path(album)}" } end render :json=>JSON.pretty_generate(output) end - def get_img_json + def get_imgs_json album = GalleryAlbum.find(params[:album_id]) images = album.gallery_images.all output = Array.new @@ -147,7 +147,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController tags << GalleryTag.find(tag)[I18n.locale] end - all_image << { + output << { image_title: image.title, image_description: image.description, image_file: { url: "http://#{request.host_with_port}#{image.file.url}", diff --git a/vendor/built_in_modules/gallery/config/routes.rb b/vendor/built_in_modules/gallery/config/routes.rb index a3877d0a..6588baeb 100644 --- a/vendor/built_in_modules/gallery/config/routes.rb +++ b/vendor/built_in_modules/gallery/config/routes.rb @@ -12,7 +12,7 @@ Rails.application.routes.draw do match "imgs" => "albums#imgs" match "upload_panel" => "albums#upload_panel" match "images_tags" => "albums#images_tags" - match "get_img_json/:album_id" => "album_images#get_img_json" + match "get_imgs_json" => "albums#get_imgs_json" collection do get "get_album_json"