Class: Gaku::Admin::SchoolsController
Instance Method Summary
collapse
#remove_picture, #set_picture
Instance Method Details
#create ⇒ Object
27
28
29
30
31
32
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 27
def create
@school = School.new(school_params)
@school.save
set_count
respond_with @school
end
|
#destroy ⇒ Object
16
17
18
19
20
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 16
def destroy
@school.destroy
set_count
respond_with @school
end
|
#edit ⇒ Object
34
35
36
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 34
def edit
respond_with @school
end
|
#edit_master ⇒ Object
12
13
14
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 12
def edit_master
respond_with @school
end
|
#index ⇒ Object
52
53
54
55
56
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 52
def index
@schools = School.all
set_count
respond_with @schools
end
|
#new ⇒ Object
22
23
24
25
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 22
def new
@school = School.new
respond_with @school
end
|
#show ⇒ Object
38
39
40
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 38
def show
respond_with @school
end
|
#update ⇒ Object
42
43
44
45
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 42
def update
@school.update(school_params)
respond_with @school
end
|
#update_master ⇒ Object
47
48
49
50
|
# File 'app/controllers/gaku/admin/schools_controller.rb', line 47
def update_master
@school.update(school_params)
respond_with @school, location: admin_school_details_edit_path
end
|