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

Clean up controller

parent 7eed995e
......@@ -8,13 +8,7 @@ class Projects::MetricsDashboardController < Projects::ApplicationController
end
def metrics_dashboard_page
@environment = if metrics_dashboard_page_params[:environment]
project.environments.find(metrics_dashboard_page_params[:environment])
else
project.default_environment
end
if @environment
if environment
render 'projects/environments/metrics'
else
render_404
......@@ -23,6 +17,15 @@ class Projects::MetricsDashboardController < Projects::ApplicationController
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
params.permit(:environment)
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