Add cluster counts to ClustersController#index

This commit is contained in:
Matija Čupić 2017-11-27 13:33:33 +01:00
parent 29ef25ccbc
commit 52bc826196
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,9 @@ class Projects::ClustersController < Projects::ApplicationController
def index
@clusters ||= project.clusters.page(params[:page]).per(20).map { |cluster| cluster.present(current_user: current_user) }
@clusters_count = @clusters.count
@active_count = project.clusters.enabled.count
@inactive_count = project.clusters.disabled.count
@all_count = @active_count + @inactive_count
end
def login