This is my blog which can be found at sudo-code.herokuapp.com
$ rails new <project_name>
$ rails server
or
$ rails s
Requires to have rails-server inside your gemfile
$ rails server --debug
$ bundle install --without production
without production does not install production bundles (unnecessary for development environment)
A scaffold includes a number of files and settings to get you started with a resource, including routes and pages utilizing the REST architectural style and the corresponding CRUD operations (new, update(edit), read(show) and delete).
$ rails generate scaffold <Model_singular_capitalized> column1:column_type column2:column_type ...
example:
$ rails generate scaffold User username:string age:integer admin:boolean
Just to generate model, without the controller, pages, etc:
Does not generate models/routes etc. Just the controller with the defined actions
$ rails generate controller <Name_plural_capitalized> action1 action2 etc... --no-test-framework
example
$ rails generate controller StaticPages home help --no-test-framework
can append --no-test-framework to skip generating of default (empty) tests
$ bundle exec rake db:migrate
$ rake db:rollback
$ rake db:migrate VERSION=0
$ bundle exec rake db:test:prepare
$ git init
$ git add .
$ git commit -m "Initial commit"
You will need to create one in github first
$ git remote add origin git@github.com:<username>/<appname>.git
$ git push -u origin master
$ git push
$ heroku create --stack cedar
$ git push heroku master
$ git push heroku
Useful when you run into any problems
$ heroku logs
$ rails generate rspec:install
$ rails generate integration_test static_pages
$ bundle exec rspec spec/
or you can define a path to run a single test or a test in a particular path
$ bundle exec rspec spec/requests/static_pages_spec.rb