Session 11: Exercises
- Create a User model. Users have a name.
- Create a Comment model. Comments have a body and user_id corresponding to the user who made the comment. Comments belong_to users.
- Implement a page which lists all of the comments that have been made along with the name of the user who made the comment.
- Create a form where someone can type in their name. When submitting, create a User object with the given name and store the ID of the user object on the session.
- Create a method on ApplicationController which allows retrieving the current_user
- Implement a form which takes in the body of a Comment and puts it in the database along with the ID of the current user.