diff --git a/app/controllers/profiles/groups_controller.rb b/app/controllers/profiles/groups_controller.rb index 793d2a32954252116699533d863103636b73d3ea..e276d07b48965f3842b14efc8a61d483104c5f3b 100644 --- a/app/controllers/profiles/groups_controller.rb +++ b/app/controllers/profiles/groups_controller.rb @@ -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 diff --git a/app/views/profiles/groups/index.html.haml b/app/views/profiles/groups/index.html.haml index 63695d7e0b957cbae72c35dc8c543c4337fb68bf..c7c657a92a6d2581119008dc542146e4bac6dd2a 100644 --- a/app/views/profiles/groups/index.html.haml +++ b/app/views/profiles/groups/index.html.haml @@ -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