Class: Admin::GroupsController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#add_userObject

put /admin/groups/:id/users/:user_id



22
23
24
25
26
# File 'app/controllers/admin/groups_controller.rb', line 22

def add_user
  link = @entity.add_user(@user)

  render json: { data: { link_id: link.id } }
end

#indexObject

get /admin/groups



6
7
8
# File 'app/controllers/admin/groups_controller.rb', line 6

def index
  @collection = Group.page_for_administration
end

#remove_userObject

delete /admin/groups/:id/users/:user_id



29
30
31
32
33
# File 'app/controllers/admin/groups_controller.rb', line 29

def remove_user
  @entity.remove_user(@user)

  head :no_content
end

#showObject

get /admin/groups/:id



11
12
13
# File 'app/controllers/admin/groups_controller.rb', line 11

def show
  @collection = @entity.users.page_for_administration(current_page)
end

#usersObject

get /admin/groups/:id/users



16
17
18
19
# File 'app/controllers/admin/groups_controller.rb', line 16

def users
  @filter     = params[:filter] || Hash.new
  @collection = User.page_for_visitors(current_page, @filter)
end