mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Add 404 page.
This commit is contained in:
parent
02ab844347
commit
f4a02ad379
@ -1,6 +1,8 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
|
||||
|
||||
def after_sign_in_path_for(resource_or_scope)
|
||||
admin_dashboard_path
|
||||
end
|
||||
@ -9,4 +11,8 @@ class ApplicationController < ActionController::Base
|
||||
new_admin_user_session_path
|
||||
end
|
||||
|
||||
def render_404
|
||||
render 'errors/not_found', :status => 404
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
class PagesController < ApplicationController
|
||||
def show
|
||||
@page = Page.find_by_name(params[:name])
|
||||
@page = Page.find_by_name!(params[:name])
|
||||
@page_title = @page.title
|
||||
end
|
||||
end
|
||||
|
||||
1
app/views/errors/not_found.html.erb
Normal file
1
app/views/errors/not_found.html.erb
Normal file
@ -0,0 +1 @@
|
||||
<h1 class="sg-1">404</h1>
|
||||
Loading…
Reference in New Issue
Block a user