2015-09-11 14:41:01 +05:30
|
|
|
class Explore::GroupsController < Explore::ApplicationController
|
2014-09-02 18:07:02 +05:30
|
|
|
def index
|
2017-08-17 22:00:37 +05:30
|
|
|
@groups = GroupsFinder.new(current_user).execute
|
|
|
|
@groups = @groups.search(params[:filter_groups]) if params[:filter_groups].present?
|
2014-09-02 18:07:02 +05:30
|
|
|
@groups = @groups.sort(@sort = params[:sort])
|
2016-06-02 11:05:42 +05:30
|
|
|
@groups = @groups.page(params[:page])
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
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-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|