```ruby
class CoursesController < ApplicationController
  
  def index
    @courses = Course.all

    respond_to do |format|
      format.html 
      format.json {render json: @courses}
    end
  end
end```

Make the index of courses render straight json
user
```ruby
class CoursesController < ApplicationController
  def index
    track = Track.find(params[:track_id])
    render json: track.courses
  end


end
```
assistant