Add group button at Profile#groups page
This commit is contained in:
parent
acb402a1c1
commit
3232f547ac
2 changed files with 11 additions and 2 deletions
|
@ -2,7 +2,7 @@ class Profiles::GroupsController < ApplicationController
|
|||
layout "profile"
|
||||
|
||||
def index
|
||||
@groups = current_user.authorized_groups.all
|
||||
@groups = current_user.authorized_groups.page(params[:page]).per(20)
|
||||
end
|
||||
|
||||
def leave
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
.ui-box
|
||||
%h5.title Groups
|
||||
%h5.title
|
||||
%strong Groups
|
||||
(#{@groups.count})
|
||||
- if current_user.can_create_group?
|
||||
%span.pull-right
|
||||
= link_to new_group_path, class: "btn btn-small btn-primary" do
|
||||
%i.icon-plus
|
||||
New Group
|
||||
%ul.well-list
|
||||
- @groups.each do |group|
|
||||
%li
|
||||
|
@ -15,3 +22,5 @@
|
|||
|
||||
= link_to group, class: 'group-name' do
|
||||
= group.name
|
||||
|
||||
= paginate @groups
|
||||
|
|
Loading…
Reference in a new issue