From 7a084fdb67426f1712003dd14e67ac2e672db588 Mon Sep 17 00:00:00 2001 From: Toru Takahashi Date: Fri, 4 May 2018 10:08:14 +0900 Subject: [PATCH] [phase-3]error page with not exist id --- app/controllers/glossary_terms_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/glossary_terms_controller.rb b/app/controllers/glossary_terms_controller.rb index ebc23a9..f2f5767 100644 --- a/app/controllers/glossary_terms_controller.rb +++ b/app/controllers/glossary_terms_controller.rb @@ -13,5 +13,7 @@ class GlossaryTermsController < ApplicationController # Find the term whose id is the :id parameter def find_term_from_id @term = GlossaryTerm.find(params[:id]) + rescue ActiveRecord::RecordNotFound + render_404 end end