Class: Gaku::GuardiansController
Instance Method Summary
collapse
#remove_picture, #set_picture
#class_name, #class_name_minus_enrollment, #class_name_underscored, #class_name_underscored_plural, #enrollment_param
#resolve_layout
Instance Method Details
#create ⇒ Object
21
22
23
24
25
26
|
# File 'app/controllers/gaku/guardians_controller.rb', line 21
def create
@guardian = Guardian.new(guardian_params)
@student.guardians << @guardian
set_count
respond_with @guardian
end
|
#destroy ⇒ Object
37
38
39
40
41
|
# File 'app/controllers/gaku/guardians_controller.rb', line 37
def destroy
@guardian.destroy
set_count
respond_with @guardian, location: [:edit, @student]
end
|
#edit ⇒ Object
28
29
30
|
# File 'app/controllers/gaku/guardians_controller.rb', line 28
def edit
respond_with @guardian
end
|
#index ⇒ Object
11
12
13
14
|
# File 'app/controllers/gaku/guardians_controller.rb', line 11
def index
@guardians = @student.guardians
respond_with @guardians
end
|
#new ⇒ Object
16
17
18
19
|
# File 'app/controllers/gaku/guardians_controller.rb', line 16
def new
@guardian = Guardian.new
respond_with @guardian
end
|
#update ⇒ Object
32
33
34
35
|
# File 'app/controllers/gaku/guardians_controller.rb', line 32
def update
@guardian.update(guardian_params)
respond_with @guardian, location: [:edit, @student, @guardian]
end
|