From 27bdbadf08057a5a19d644324f4d90b71f4343ee Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 31 Jan 2011 15:58:28 +0800 Subject: [PATCH] 404 for pages and asset column error --- app/controllers/pages_controller.rb | 21 ++++++++++++--------- app/views/admin/assets/index.html.erb | 2 +- config/locales/en.yml | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 8c6b8000..8f68e216 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -9,16 +9,19 @@ class PagesController < ApplicationController end end - def show - item = Item.first(:conditions => {:full_name => params[:page_name]}) - case item._type - when 'Page' - @page = item - render_liquid_page - when 'Link' - redirect_to "http://#{item[:url]}" + def show + begin + item = Item.first(:conditions => {:full_name => params[:page_name]}) + case item._type + when 'Page' + @page = item + render_liquid_page + when 'Link' + redirect_to "http://#{item[:url]}" + end + rescue + render :file => "#{Rails.root}/public/404.html", :status => :not_found end - end end diff --git a/app/views/admin/assets/index.html.erb b/app/views/admin/assets/index.html.erb index 093696cf..a3f77742 100644 --- a/app/views/admin/assets/index.html.erb +++ b/app/views/admin/assets/index.html.erb @@ -12,7 +12,7 @@ <%= t('admin.description') %> <%= t('admin.format') %> <%= t('admin.orig_upload_file') %> - <%= t('admin.file_name') %> + <%= t('admin.file_size') %> <%= t('admin.action') %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 63e68696..11a85ac2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -48,7 +48,7 @@ en: editing_user_attribute: Editing user attribute enable_language: Enable language file_name: Filename - filr_size: File size + file_size: File size format: Format is_published: Is published item: Item