class HomeController < ApplicationController def index @page_title = "I miei progetti" @projects = available_projects if !current_user.admin? && @projects.one? redirect_to project_root_path(project_code: @projects.first.code) and return end end end