2015-04-30 13:06:18 -04:00
|
|
|
class Explore::GroupsController < Explore::ApplicationController
|
2014-07-11 12:29:51 -04:00
|
|
|
def index
|
2017-05-03 19:51:25 -04:00
|
|
|
@groups = GroupsFinder.new(current_user).execute
|
2017-03-01 08:31:56 -05:00
|
|
|
@groups = @groups.search(params[:filter_groups]) if params[:filter_groups].present?
|
2014-07-11 12:29:51 -04:00
|
|
|
@groups = @groups.sort(@sort = params[:sort])
|
2016-03-19 17:37:54 -04:00
|
|
|
@groups = @groups.page(params[:page])
|
2017-03-01 08:31:56 -05:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.json do
|
|
|
|
render json: {
|
|
|
|
html: view_to_html_string("explore/groups/_groups", locals: { groups: @groups })
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2014-07-11 12:29:51 -04:00
|
|
|
end
|
|
|
|
end
|