Class: GroupsController
Instance Attribute Summary
#current_user, #current_user Used for unit testing, this is normally managed by Devise
Instance Method Summary
collapse
#clear_search_index, #search_params
Instance Method Details
#create ⇒ Object
37
38
39
40
41
42
43
44
45
|
# File 'app/controllers/groups_controller.rb', line 37
def create
@group = Group.new(group_params)
if @group.save
redirect_to @group, notice: 'Group was successfully created.'
else
render :new
end
end
|
#destroy ⇒ Object
60
61
62
63
|
# File 'app/controllers/groups_controller.rb', line 60
def destroy
@group.destroy
redirect_to groups_url, notice: 'Group was successfully destroyed.'
end
|
#edit ⇒ Object
31
32
|
# File 'app/controllers/groups_controller.rb', line 31
def edit
end
|
#index ⇒ Object
16
17
18
|
# File 'app/controllers/groups_controller.rb', line 16
def index
@groups = Group.all
end
|
#new ⇒ Object
26
27
28
|
# File 'app/controllers/groups_controller.rb', line 26
def new
@group = Group.new
end
|
#show ⇒ Object
22
23
|
# File 'app/controllers/groups_controller.rb', line 22
def show
end
|
#update ⇒ Object
50
51
52
53
54
55
56
|
# File 'app/controllers/groups_controller.rb', line 50
def update
if @group.update(group_params)
redirect_to @group, notice: 'Group was successfully updated.'
else
render :edit
end
end
|