#Rails coding cheatsheet
Generate a complete scaffold (migration, model, controller, views)
rails g scaffold Object attribute:datatype
Eg. Create a scaffold for a book with a title, author and summary
rails g scaffold Book title:string author:string summary:text
Generate a controller and view/s
rails g controller controller_name action
Eg. Create a home index page/home controller with index action
rails g controller home index
Generate a data model with corresponding migration (a data model/database table)
rails g model Object attribute:datatype
Add an attribute to a data model/database table
rails g migration AddAttributeToObject attribute:datatype
Ctrl + C
Get stats on your Ruby on Rails code
create database tables from migration file
seed the database with data in db/seeds.rb file
rollback the last migration
Initialize a git repository for your app
Add all files to your repository
Commit all changes to your repository
Check the state of your git repository
Check your repository remote links
Push the master branch of your repository to a remote named origin
Create a new branch and checkout the new branch in one command
git checkout -b newbranch
Create a new app/repository on Heroku
heroku run rake db:migrate