web/mooctracker_rails/app/controllers/courses_controller.rb
def create
    @course = current_user.courses.build(course_params)

    if @course.save
      render json: @course
    else
      @course_items = []
    end
  end
#On POST request to /courses it creates a course with sent data
On POST request to /courses it creates a course with sent data
On POST request to / courses it creates a course with sent data
def create
    @course = current_user.courses.build(course_params)
    if @course.save
      render json: @course
    else
      @course_items = []
    end
  end
def create @course = current_user . courses . build ( course_params ) if @course . save render json : @course else @course_items = [ ] end end
On POST request to /courses it creates a course with sent data
On POST request to / courses it creates a course with sent data