- Go to your sandbox
- Create a new rails app:
$ rails new ar-practice
. - Create a model called
Student
with a name and at least two other attributes of your choice (like favorite pie and personal motto):$ rails g model student name:string other_field:type
- Migrate your database:
$ rake db:migrate
- Enter the rails console:
$ rails console
- Create a record in the database for yourself using
new
orcreate
. - Create a record in the database for all the students in your pod. Ask each of them for the information you've defined for your student class.
- If you're asking someone a question who has not yet setup their
Student
model, offer to help. - After all 5 records are created. Read about and experiment with the following ActiveRecord methods:
find
where
find_by
destroy
where.not