404 for pages and asset column error
This commit is contained in:
parent
d28a71f5bf
commit
27bdbadf08
|
@ -9,16 +9,19 @@ class PagesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
item = Item.first(:conditions => {:full_name => params[:page_name]})
|
begin
|
||||||
case item._type
|
item = Item.first(:conditions => {:full_name => params[:page_name]})
|
||||||
when 'Page'
|
case item._type
|
||||||
@page = item
|
when 'Page'
|
||||||
render_liquid_page
|
@page = item
|
||||||
when 'Link'
|
render_liquid_page
|
||||||
redirect_to "http://#{item[:url]}"
|
when 'Link'
|
||||||
|
redirect_to "http://#{item[:url]}"
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
render :file => "#{Rails.root}/public/404.html", :status => :not_found
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<th><%= t('admin.description') %></th>
|
<th><%= t('admin.description') %></th>
|
||||||
<th><%= t('admin.format') %></th>
|
<th><%= t('admin.format') %></th>
|
||||||
<th><%= t('admin.orig_upload_file') %></th>
|
<th><%= t('admin.orig_upload_file') %></th>
|
||||||
<th><%= t('admin.file_name') %></th>
|
<th><%= t('admin.file_size') %></th>
|
||||||
<th><%= t('admin.action') %></th>
|
<th><%= t('admin.action') %></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ en:
|
||||||
editing_user_attribute: Editing user attribute
|
editing_user_attribute: Editing user attribute
|
||||||
enable_language: Enable language
|
enable_language: Enable language
|
||||||
file_name: Filename
|
file_name: Filename
|
||||||
filr_size: File size
|
file_size: File size
|
||||||
format: Format
|
format: Format
|
||||||
is_published: Is published
|
is_published: Is published
|
||||||
item: Item
|
item: Item
|
||||||
|
|
Reference in New Issue