Class: Gaku::Admin::SchoolsController

Inherits:
BaseController show all
Includes:
AdminPictureController
Defined in:
app/controllers/gaku/admin/schools_controller.rb

Instance Method Summary collapse

Methods included from AdminPictureController

#remove_picture, #set_picture

Instance Method Details

#createObject



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

#destroyObject



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

#editObject



34
35
36
# File 'app/controllers/gaku/admin/schools_controller.rb', line 34

def edit
  respond_with @school
end

#edit_masterObject



12
13
14
# File 'app/controllers/gaku/admin/schools_controller.rb', line 12

def edit_master
  respond_with @school
end

#indexObject



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

#newObject



22
23
24
25
# File 'app/controllers/gaku/admin/schools_controller.rb', line 22

def new
  @school = School.new
  respond_with @school
end

#showObject



38
39
40
# File 'app/controllers/gaku/admin/schools_controller.rb', line 38

def show
  respond_with @school
end

#updateObject



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_masterObject



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