Demo Rails App from railstutorial.org
- Users
- Microposts
$ rails generate scaffold User name:string email:string
$ bundle exec rake db:migrate
$ git commit -a -m "Improve the README file"
Add all modifications and commit
$ git push
Push changes to github origin master
- Length validation: edit app/models/model_name.rb, and add:
validates :content, length: { maximum: 140 }
- has_many and belongs_to: edit app/models/model_name.rb, and add:
has_many :microposts
Edit 2nd model and add:belongs_to : user
- heroku create
- git push keroku master
enigmatic-anchorage-4562 - heroku run rake db:migrate
migrate the production database