web/mooctracker_rails/app/controllers/projects_controller.rb
#On GET request to /projects it returns all projects.
On GET request to /projects it returns all projects.
On GET request to / projects it returns all projects .
def index
    if current_user.admin?
      @projects= Project.all
      render json: @projects
    else
    	@projects= Project.where("user_id = ?", current_user)
    	render json: @projects
    end
  end
def index if current_user . admin? @projects = Project . all render json : @projects else @projects = Project . where ( "user_id = ?" , current_user ) render json : @projects end end
On GET request to /projects it returns all projects.
On GET request to / projects it returns all projects .