Commit f8137075 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show correct group membership in profile

parent 0b747a0f
...@@ -2,7 +2,7 @@ class Profiles::GroupsController < ApplicationController ...@@ -2,7 +2,7 @@ class Profiles::GroupsController < ApplicationController
layout "profile" layout "profile"
def index def index
@groups = current_user.authorized_groups.page(params[:page]).per(20) @user_groups = current_user.users_groups.page(params[:page]).per(20)
end end
def leave def leave
......
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
.ui-box .ui-box
.title .title
%strong Groups %strong Groups
(#{@groups.count}) (#{@user_groups.count})
%ul.well-list %ul.well-list
- @groups.each do |group| - @user_groups.each do |user_group|
- group = user_group.group
%li %li
.pull-right .pull-right
- if can?(current_user, :manage_group, group) - if can?(current_user, :manage_group, group)
...@@ -28,4 +29,7 @@ ...@@ -28,4 +29,7 @@
= link_to group, class: 'group-name' do = link_to group, class: 'group-name' do
= group.name = group.name
= paginate @groups as #{user_group.human_access}
= paginate @user_groups
Markdown is supported
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