2015-04-30 13:06:18 -04:00
|
|
|
class Dashboard::GroupsController < Dashboard::ApplicationController
|
2013-07-12 11:22:03 -04:00
|
|
|
def index
|
2017-03-01 08:31:56 -05:00
|
|
|
@group_members = current_user.group_members.includes(source: :route).joins(:group)
|
|
|
|
@group_members = @group_members.merge(Group.search(params[:filter_groups])) if params[:filter_groups].present?
|
|
|
|
@group_members = @group_members.merge(Group.sort(@sort = params[:sort]))
|
|
|
|
@group_members = @group_members.page(params[:page])
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.json do
|
|
|
|
render json: {
|
|
|
|
html: view_to_html_string("dashboard/groups/_groups", locals: { group_members: @group_members })
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2013-07-12 11:22:03 -04:00
|
|
|
end
|
|
|
|
end
|