To Examples

DisplayGradeData Directions

 

  1. Create a new rails project named DisplayGradeData.
     
  2. Navigate to the DisplayGradeData folder.
     
  3. Generate a model named GradeRecord with these fields:
     
    Field Datatype
    stud_id integer
    last_name string
    first_name string
    course_number string
    course_name string
    prof_name string
    credit_hours integer
    grade string

     
  4. Enter this rake statement to create the database:
  5. Append this Seed Code to the file db/seed.rb.
     
  6. Run the seed code by entering this rake command in the Command Prompt Window:
  7. Check how many rows were entered into the grade_records table by starting the Rails Console and entering
  8. Generate a controller with name GradeRecords and view display.
     
  9. Use this code for the controller grade_records_controller.rb.
     
  10. Use this code for the view display.html.erb.
     
  11. View the grade record data in the index view in a browser at this URL: