Class: GroupsUsersController

Inherits:
AuthzController show all
Defined in:
app/controllers/groups_users_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
# File 'app/controllers/groups_users_controller.rb', line 4

def create
  if @user && @group
    @user.groups << @group
  end 
  respond_to do |format|
    format.html { redirect_to :back }
  end 
end

#destroyObject



13
14
15
16
17
18
19
20
# File 'app/controllers/groups_users_controller.rb', line 13

def destroy
  if @user && @group
    @user.groups.delete(@group)
  end 
  respond_to do |format|
    format.html { redirect_to :back }
  end
end