correct pic file format

This commit is contained in:
Rueshyna 2013-01-03 18:16:00 +08:00
parent 8e33313b13
commit 8815533075
2 changed files with 98 additions and 104 deletions

View File

@ -177,7 +177,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
theater_link: panel_gallery_back_end_album_image_path(values), theater_link: panel_gallery_back_end_album_image_path(values),
description: values.description, description: values.description,
title: values.title, title: values.title,
file: values.file, file: values.file.as_json[:file],
gallery_album_id: values.gallery_album_id, gallery_album_id: values.gallery_album_id,
tag_ids: values.tag_ids, tag_ids: values.tag_ids,
tag_names: tags} tag_names: tags}

View File

@ -1,7 +1,5 @@
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
def index def index
end end
def show def show
@ -10,7 +8,6 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
@album.tag_ids.each do |tag| @album.tag_ids.each do |tag|
@tags << GalleryTag.find(tag)[I18n.locale] @tags << GalleryTag.find(tag)[I18n.locale]
end end
end end
def get_albums def get_albums
@ -61,8 +58,6 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
render :json=>@output.to_json render :json=>@output.to_json
end end
def imgs def imgs
@album = GalleryAlbum.find(params[:id]) @album = GalleryAlbum.find(params[:id])
@images = @album.gallery_images.all @images = @album.gallery_images.all
@ -72,9 +67,16 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
values.tag_ids.each do |tag| values.tag_ids.each do |tag|
tags << GalleryTag.find(tag)[I18n.locale] tags << GalleryTag.find(tag)[I18n.locale]
end end
@output << {"_id"=>values.id,"theater_link"=>theater_panel_gallery_front_end_album_path(values),"description"=>values.description,"title"=>values.title,"file"=>values.file,"gallery_album_id"=>values.gallery_album_id,"tag_ids"=>values.tag_ids,"tag_names"=>tags} @output << {:_id => values.id,
:theater_link => theater_panel_gallery_front_end_album_path(values),
:description => values.description,
:title => values.title,
:file => values.file.as_json[:file],
:gallery_album_id => values.gallery_album_id,
:tag_ids => values.tag_ids,
:tag_names => tags}
end end
render :json=>{"images" => @output}.to_json render :json=>{:images => @output}.to_json
end end
def images_tags def images_tags
@ -99,12 +101,4 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
end end
@back_link = panel_gallery_front_end_album_path(@albumid) @back_link = panel_gallery_front_end_album_path(@albumid)
end end
end end