Skip to content

Commit

Permalink
Add availabilities/subjects/grade levels to mentor show page
Browse files Browse the repository at this point in the history
  • Loading branch information
katushe committed May 14, 2016
1 parent 2338312 commit 4f784b2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mentors4all/app/controllers/mentors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ def create
end

def show
@mentor = Mentor.find(params[:id])
render json: {mentor: @mentor, availabilities: @mentor.availabilities, grade_levels: @mentor.grade_levels, subjects: @mentor.cs_subjects}
end

def update
@mentor = Mentor.find(params[:id])
@mentor.update_attributes(mentor_params)

render json: {mentor: @mentor}
end

private
def mentor_params
params.require(:mentor).permit(:location, :employment_status, :employment_location, :prior_experience, :courses_taken, :interest_in_mentoring, :example_explanation, :cs_expertise)
end
end

0 comments on commit 4f784b2

Please sign in to comment.