|
|
|
@ -31,7 +31,7 @@ class GroupsController < ApplicationController |
|
|
|
|
layout 'admin' |
|
|
|
|
|
|
|
|
|
before_action :require_admin |
|
|
|
|
before_action :find_group, only: [:destroy, :autocomplete_for_user, |
|
|
|
|
before_action :find_group, only: [:destroy, |
|
|
|
|
:show, :create_memberships, :destroy_membership, |
|
|
|
|
:edit_membership] |
|
|
|
|
|
|
|
|
@ -136,11 +136,6 @@ class GroupsController < ApplicationController |
|
|
|
|
redirect_to controller: '/groups', action: 'edit', id: @group, tab: 'users' |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def autocomplete_for_user |
|
|
|
|
@users = User.active.not_in_group(@group).like(params[:q]).limit(100) |
|
|
|
|
render layout: false |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def create_memberships |
|
|
|
|
membership_params = permitted_params.group_membership |
|
|
|
|
membership_id = membership_params[:membership_id] |
|
|
|
|