Class: Gaku::Api::V1::SyllabusesController
- Inherits:
-
BaseController
- Object
- ActionController::API
- ApplicationController
- BaseController
- Gaku::Api::V1::SyllabusesController
- Defined in:
- app/controllers/gaku/api/v1/syllabuses_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/gaku/api/v1/syllabuses_controller.rb', line 17 def create @syllabus = Syllabus.new(syllabus_params) if @syllabus.save! member_respond_to @syllabus end end |
#destroy ⇒ Object
30 31 32 33 34 |
# File 'app/controllers/gaku/api/v1/syllabuses_controller.rb', line 30 def destroy if @syllabus.destroy! member_respond_to @syllabus end end |
#index ⇒ Object
8 9 10 11 |
# File 'app/controllers/gaku/api/v1/syllabuses_controller.rb', line 8 def index @syllabuses = Syllabus.all.page(params[:page ]) collection_respond_to @syllabuses, root: :syllabuses end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/gaku/api/v1/syllabuses_controller.rb', line 13 def show member_respond_to @syllabus end |
#update ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/gaku/api/v1/syllabuses_controller.rb', line 24 def update if @syllabus.update!(syllabus_params) member_respond_to @syllabus end end |