Commit 3232f547 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add group button at Profile#groups page

parent acb402a1
...@@ -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.all @groups = current_user.authorized_groups.page(params[:page]).per(20)
end end
def leave def leave
......
.ui-box .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 %ul.well-list
- @groups.each do |group| - @groups.each do |group|
%li %li
...@@ -15,3 +22,5 @@ ...@@ -15,3 +22,5 @@
= link_to group, class: 'group-name' do = link_to group, class: 'group-name' do
= group.name = group.name
= paginate @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