diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-20 14:47:56 -0700 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-20 14:47:56 -0700 |
commit | 884eb6b5e51b9e0e8aa5ae5ed0eeb25fcbda685e (patch) | |
tree | d300b9177706025069d358781b2c635ac08ddb8f /app/controllers/public_body_controller.rb | |
parent | 97f8d8340e867bcca0fd349e66a83a2860aaea9f (diff) |
Respond to a (currently unsupported) json request for a public body list with a 406, not a 500 caused by a missing template.
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 74ea043bb..374866eda 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -131,7 +131,9 @@ class PublicBodyController < ApplicationController @public_bodies = PublicBody.where(conditions).joins(:translations).order("public_body_translations.name").paginate( :page => params[:page], :per_page => 100 ) - render :template => "public_body/list" + respond_to do |format| + format.html { render :template => "public_body/list" } + end end end |