Great! You created a new Rails app named MessengerApp.
Looking at this diagram of the request/response cycle, we need four parts to build a Rails app - a model, a route, a controller, and a view.
Let’s start here by creating a model.
In the terminal, generate a new model named
rails generate model Message
Open the migration file in db/migrate/ for the messages table. The name of the migration file starts with the timestamp of when it was created. Inside the
change method, add this line as line 4:
Then in the terminal, run
bundle exec rake db:migrate
bundle exec rake db:seed