diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 074a1cfd..23654497 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 71821080..3b59a895 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -114,6 +114,7 @@ class ProjectsController < ApplicationController def project @project ||= Project.find_by_code(params[:id]) + @project || render_404 end def determine_layout diff --git a/public/404.html b/public/404.html index 16d8fcbc..33325890 100644 --- a/public/404.html +++ b/public/404.html @@ -2,22 +2,12 @@