Commit f8137075 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Show correct group membership in profile

parent 0b747a0f
......@@ -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
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment