diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-20 16:53:05 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-20 16:53:23 +0300 |
commit | 15b7b9ec4117bf19168ea0f923ea11e926edcc5c (patch) | |
tree | 76c9092445c3619d343c810541e49a84522624b1 /app/controllers/projects/deployments_controller.rb | |
parent | 57ff963129a37b27f3944f0ec2d0212da9b23e84 (diff) |
Add rescue_from(ActionController::UnknownFormat) in Application Controller
Diffstat (limited to 'app/controllers/projects/deployments_controller.rb')
-rw-r--r-- | app/controllers/projects/deployments_controller.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/controllers/projects/deployments_controller.rb b/app/controllers/projects/deployments_controller.rb index acf5573935a..47c312ffddf 100644 --- a/app/controllers/projects/deployments_controller.rb +++ b/app/controllers/projects/deployments_controller.rb @@ -25,12 +25,16 @@ class Projects::DeploymentsController < Projects::ApplicationController def additional_metrics return render_404 unless deployment.has_additional_metrics? - metrics = deployment.additional_metrics - - if metrics.any? - render json: metrics - else - head :no_content + respond_to do |format| + format.json do + metrics = deployment.additional_metrics + + if metrics.any? + render json: metrics + else + head :no_content + end + end end end |