Skip to content

Commit

Permalink
throw a 404 on missing pages. this fixes Z-B
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcfadden committed Jun 2, 2021
1 parent aeda163 commit b693648
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def show
if valid_page?
render template: "pages/#{params[:page]}"
else
render file: "public/404.html", status: :not_found, format: [:html]
raise ActiveRecord::RecordNotFound
end
end

Expand Down
5 changes: 5 additions & 0 deletions app/views/errors/internal_server_error.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="container">
<h1>Internal Server Error</h1>

<p>Developers have been alerted.</p>
</div>
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
config.eager_load = false

# Show full error reports.
# set this to false to test 404 pages
config.consider_all_requests_local = true

config.cache_store = :memory_store, { size: 32.megabytes }
Expand Down

0 comments on commit b693648

Please sign in to comment.