Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/catch_all_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class CatchAllController < ApplicationController
def catch_all
render status: 404
end
end
3 changes: 3 additions & 0 deletions app/views/catch_all/catch_all.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h2 class="title title-page">Ooops! The requested page was not found.</h2>

<p><%= link_to('Starting over', root_path) %> may help. If it does not, please <%= link_to('let us know', feedback_path) %>!</p>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@

get 'item_status', to: 'aleph#item_status'
get 'debug', to: 'application#debug'

get '*path', to: 'catch_all#catch_all'
end
8 changes: 8 additions & 0 deletions test/integration/catch_all_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class CatchAllTest < ActionDispatch::IntegrationTest
test 'handle 404s' do
get '/blargh'
assert_response :not_found
end
end