Workflow for Creating Rails Applications
1. Use the rails command to create the basic skeleton of the application.
rails new library --database=postgresql
2. Create a database on the PostgreSQL server to hold your data.
create role myapp with createdb login password 'password1';
rails db:create db:migrate
3. Configure the application to know where your database is located and the login credentials for it.
4. Create Rails Active Records (Models), because they are the business objects you'll be working with in your controllers.
rails g model Book
rails g model Subject
5. Generate Migrations that simplify the creating and maintaining of database tables and columns.
rails db:migrate
6. Write Controller Code to put a life in your application.
rails g controller Book
7. Create Views to present your data through User Interface.
rails generate migration AddStatusToArticles status:string
rails generate migration AddStatusToComments status:string