From 7f4f8285ab0c6182adfe4efe5c03f2e2aae2b6bd Mon Sep 17 00:00:00 2001 From: Ruling-Mac Date: Wed, 21 Oct 2015 15:52:22 +0800 Subject: [PATCH] fix page url and add data for frontend --- app/controllers/digital_archives_controller.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/digital_archives_controller.rb b/app/controllers/digital_archives_controller.rb index 73ccb2d..06cf101 100644 --- a/app/controllers/digital_archives_controller.rb +++ b/app/controllers/digital_archives_controller.rb @@ -46,11 +46,22 @@ class DigitalArchivesController < ApplicationController { "title" => (dca.title rescue ""), "item-date" => (dca.item_date rescue ""), + "location" => (dca.location rescue ""), + "department" => (dca.department rescue ""), + "character" => (dca.character rescue ""), + "description" => (dca.description rescue ""), + "detail_description" => (dca.detail_description rescue ""), + "material" => (dca.material rescue ""), + "size" => (dca.size rescue ""), + "item_id" => (dca.item_id rescue ""), + "item_from" => (dca.item_from rescue ""), + "item_status" => (dca.item_status rescue ""), + "album_content" => (dca.album_content rescue ""), "files" => dcafs } end page = Page.where(:page_id => params[:page_id]).first rescue nil - url = page.nil? ? "#" : "/#{I18n.locale.to_s}/#{page.url}" + url = page.nil? ? "#" : "/#{I18n.locale.to_s}#{page.url}" { "digital_content_archives" => dcas, "extras" => {