aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/public_body_controller.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-09-25 17:58:06 +0200
committerDavid Cabo <david@calibea.com>2011-09-25 17:58:06 +0200
commitd95fc384afd82a0ebeb7e4578ab738798bcea204 (patch)
tree698ea4507fe0b72c23464e4897ecd47e893f1167 /app/controllers/public_body_controller.rb
parent4a9fc81290b9363b2ecad4c05e77cfb1c7b49096 (diff)
Show 404 instead of error page when body can't be found. Fixes #196
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r--app/controllers/public_body_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index a6536eee1..ac75da068 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -19,7 +19,10 @@ class PublicBodyController < ApplicationController
@locale = self.locale_from_params()
PublicBody.with_locale(@locale) do
@public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
- raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil? # XXX proper 404
+ if @public_body.nil?
+ render :template => 'public/404.html'
+ return
+ end
if @public_body.url_name.nil?
redirect_to :back
return