Show correct group membership in profile

This commit is contained in:
Dmitriy Zaporozhets 2013-08-06 18:03:13 +03:00
parent 0b747a0f4a
commit f8137075d5
2 changed files with 8 additions and 4 deletions

View file

@ -2,7 +2,7 @@ class Profiles::GroupsController < ApplicationController
layout "profile"
def index
@groups = current_user.authorized_groups.page(params[:page]).per(20)
@user_groups = current_user.users_groups.page(params[:page]).per(20)
end
def leave

View file

@ -11,9 +11,10 @@
.ui-box
.title
%strong Groups
(#{@groups.count})
(#{@user_groups.count})
%ul.well-list
- @groups.each do |group|
- @user_groups.each do |user_group|
- group = user_group.group
%li
.pull-right
- if can?(current_user, :manage_group, group)
@ -28,4 +29,7 @@
= link_to group, class: 'group-name' do
= group.name
= paginate @groups
as #{user_group.human_access}
= paginate @user_groups