Class: Syllabuses::ExamsController

Inherits:
GakuController
  • Object
show all
Defined in:
app/controllers/gaku/syllabuses/exams_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 16

def create
  @exam = Exam.new(exam_params)
  @exam.department = @syllabus.department
  @exam.save!
  @syllabus.exams << @exam

  set_count
  respond_with @exam
end

#destroyObject



34
35
36
37
38
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 34

def destroy
  @exam.destroy
  set_count
  respond_with @exam
end

#editObject



26
27
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 26

def edit
end

#newObject



10
11
12
13
14
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 10

def new
  @exam = Exam.new
  @exam.exam_portions.build
  respond_with @exam
end

#updateObject



29
30
31
32
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 29

def update
  @exam.update(exam_params)
  respond_with @exam
end