Class: ClassGroups::StudentReviewsController

Inherits:
GakuController
  • Object
show all
Defined in:
app/controllers/gaku/class_groups/student_reviews_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
# File 'app/controllers/gaku/class_groups/student_reviews_controller.rb', line 15

def create
  @student_review = @class_group.student_reviews.create!(student_review_params)
  respond_with @student_review
end

#destroyObject



28
29
30
31
# File 'app/controllers/gaku/class_groups/student_reviews_controller.rb', line 28

def destroy
  @student_review.destroy!
  respond_with @student_review
end

#editObject



20
21
# File 'app/controllers/gaku/class_groups/student_reviews_controller.rb', line 20

def edit
end

#indexObject



10
11
12
13
# File 'app/controllers/gaku/class_groups/student_reviews_controller.rb', line 10

def index
  @student_reviews = @class_group.student_reviews.where(student_id: params[:student_id])
  respond_with @student_reviews
end

#updateObject



23
24
25
26
# File 'app/controllers/gaku/class_groups/student_reviews_controller.rb', line 23

def update
  @student_review.update(student_review_params)
  respond_with @student_review
end