To Examples
LoadGradeData Directions
Create a new rails project named LoadGradeData.
Navigate to the LoadGradeData folder.
Generate a scaffold 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
Enter this rake statement to create the database:
rake db:migrate
Append this
Seed Code
to the file db/seed.rb.
Run the seed code by entering this rake command in the Command Prompt Window:
rake db:seed
View the grade record data in the index view in a browser at this URL:
http://localhost:3000/grade_records