Class: Wobauth::GroupsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/wobauth/groups_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability

Instance Method Details

#createObject

POST /groups



30
31
32
33
34
35
# File 'app/controllers/wobauth/groups_controller.rb', line 30

def create
  @group = Group.new(group_params)

  @group.save
  respond_with(@group)
end

#destroyObject

DELETE /groups/1



44
45
46
47
# File 'app/controllers/wobauth/groups_controller.rb', line 44

def destroy
  @group.destroy
  respond_with(@group)
end

#editObject

GET /groups/1/edit



26
27
# File 'app/controllers/wobauth/groups_controller.rb', line 26

def edit
end

#indexObject

GET /groups



9
10
11
12
# File 'app/controllers/wobauth/groups_controller.rb', line 9

def index
  @groups = Group.all
  respond_with(@groups)
end

#newObject

GET /groups/new



20
21
22
23
# File 'app/controllers/wobauth/groups_controller.rb', line 20

def new
  @group = Group.new
  respond_with(@group)
end

#showObject

GET /groups/1



15
16
17
# File 'app/controllers/wobauth/groups_controller.rb', line 15

def show
  respond_with(@group)
end

#updateObject

PATCH/PUT /groups/1



38
39
40
41
# File 'app/controllers/wobauth/groups_controller.rb', line 38

def update
  @group.update(group_params)
  respond_with(@group)
end