Filter projects on dashboard

This commit is contained in:
Dmitriy Zaporozhets 2012-11-30 06:14:05 +03:00
parent a03f318964
commit c38b9a2f80
5 changed files with 46 additions and 0 deletions

View file

@ -7,6 +7,15 @@ class DashboardController < ApplicationController
def index
@groups = current_user.authorized_groups
@projects = case params[:scope]
when 'personal' then
@projects.personal(current_user)
when 'joined' then
@projects.joined(current_user)
else
@projects
end
@projects = @projects.page(params[:page]).per(30)
@events = Event.in_projects(current_user.project_ids)