Class: Syllabuses::ExamsController
- Inherits:
-
GakuController
- Object
- GakuController
- Syllabuses::ExamsController
- Defined in:
- app/controllers/gaku/syllabuses/exams_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
26 27 |
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 26 def edit end |
#new ⇒ Object
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 |
#update ⇒ Object
29 30 31 32 |
# File 'app/controllers/gaku/syllabuses/exams_controller.rb', line 29 def update @exam.update(exam_params) respond_with @exam end |