Commit 8ec12e42 authored by Ryan Cobb's avatar Ryan Cobb

Clean up controller

parent 7eed995e
...@@ -8,13 +8,7 @@ class Projects::MetricsDashboardController < Projects::ApplicationController ...@@ -8,13 +8,7 @@ class Projects::MetricsDashboardController < Projects::ApplicationController
end end
def metrics_dashboard_page def metrics_dashboard_page
@environment = if metrics_dashboard_page_params[:environment] if environment
project.environments.find(metrics_dashboard_page_params[:environment])
else
project.default_environment
end
if @environment
render 'projects/environments/metrics' render 'projects/environments/metrics'
else else
render_404 render_404
...@@ -23,6 +17,15 @@ class Projects::MetricsDashboardController < Projects::ApplicationController ...@@ -23,6 +17,15 @@ class Projects::MetricsDashboardController < Projects::ApplicationController
private private
def environment
@environment ||=
if metrics_dashboard_page_params[:environment]
project.environments.find(metrics_dashboard_page_params[:environment])
else
project.default_environment
end
end
def metrics_dashboard_page_params def metrics_dashboard_page_params
params.permit(:environment) params.permit(:environment)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment