app/controllers/educators_controller.rb
# Authentication by default inherited from ApplicationController.
Authentication by default inherited from ApplicationController.
Authentication by default inherited from ApplicationController .
def my_students_json
    students = authorized { Student.active.includes(:school).to_a }
    students_json = students.as_json({
      only: [
        :id,
        :first_name,
        :last_name,
        :grade,
        :house,
        :counselor,
        :sped_liaison,
        :program_assigned,
        :sped_placement
      ],
      include: {
        school: {
          only: [:id, :name]
        }
      }
    })
    render json: {
      students: students_json
    }
  end
def my_students_json students = authorized { Student . active . includes ( :school ) . to_a } students_json = students . as_json ( { only : [ :id , :first_name , :last_name , :grade , :house , :counselor , :sped_liaison , :program_assigned , :sped_placement ] , include : { school : { only : [ :id , :name ] } } } ) render json : { students : students_json } end
Authentication by default inherited from ApplicationController.
Authentication by default inherited from ApplicationController .