Status codes for errors, New error pages
This commit is contained in:
parent
7d279f9302
commit
81092c0198
6 changed files with 71 additions and 41 deletions
|
@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound do |exception|
|
||||
render "errors/not_found", :layout => "error"
|
||||
render "errors/not_found", :layout => "error", :status => 404
|
||||
end
|
||||
|
||||
layout :layout_by_resource
|
||||
|
@ -58,15 +58,15 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def access_denied!
|
||||
render "errors/access_denied", :layout => "error"
|
||||
render "errors/access_denied", :layout => "error", :status => 404
|
||||
end
|
||||
|
||||
def not_found!
|
||||
render "errors/not_found", :layout => "error"
|
||||
render "errors/not_found", :layout => "error", :status => 404
|
||||
end
|
||||
|
||||
def git_not_found!
|
||||
render "errors/git_not_found", :layout => "error"
|
||||
render "errors/git_not_found", :layout => "error", :status => 404
|
||||
end
|
||||
|
||||
def method_missing(method_sym, *arguments, &block)
|
||||
|
|
|
@ -114,6 +114,7 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def project
|
||||
@project ||= Project.find_by_code(params[:id])
|
||||
@project || render_404
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue