1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Add 404 page.

This commit is contained in:
Dan Barber 2013-05-30 09:06:08 +01:00
parent 02ab844347
commit f4a02ad379
3 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,8 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery protect_from_forgery
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
def after_sign_in_path_for(resource_or_scope) def after_sign_in_path_for(resource_or_scope)
admin_dashboard_path admin_dashboard_path
end end
@ -9,4 +11,8 @@ class ApplicationController < ActionController::Base
new_admin_user_session_path new_admin_user_session_path
end end
def render_404
render 'errors/not_found', :status => 404
end
end end

View File

@ -1,6 +1,6 @@
class PagesController < ApplicationController class PagesController < ApplicationController
def show def show
@page = Page.find_by_name(params[:name]) @page = Page.find_by_name!(params[:name])
@page_title = @page.title @page_title = @page.title
end end
end end

View File

@ -0,0 +1 @@
<h1 class="sg-1">404</h1>