diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 3b0950c..aa5d5ee 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,7 +1,15 @@ class HomeController < ApplicationController - def index - @latest_projects = Project.latest(5) - @latest_repositories = Repository.latest(5) - @latest_configurations = KalibroConfiguration.latest(5) + helper_method :latest_projects, :latest_repositories, :latest_configurations + + def latest_projects(count) + Project.latest(count) + end + + def latest_repositories(count) + Repository.latest(count) + end + + def latest_configurations(count) + KalibroConfiguration.latest(count) end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index c08047f..2cd4124 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -13,7 +13,7 @@