Hartl Rails Tutorial
Rails Tutorial
Set up
-
rails new project_name(orrails new project_name --database=postgresql) -
cd project_name -
subl .to open the new project directory in sublime text -
Edit the Gemfile
-
bundle install --without production -
bundle upgradeto upgrade all gems to the most recent version -
bundle install -
Edit the .gitignore
-
git init -
git add -A -
git commit -m 'Initial commit' -
Edit the README.rdoc and rename to README.md using
git mv, commit changes -
git remote add origin git@bitbucket.org:<username>/sample_app.git -
git push -u origin --all -
heroku create -
git push heroku master -
git checkout -fto force checkout of files from repo, overwriting any local changes -
git checkout -b new-branchto create and switch to a new branch
Branch, edit, commit, merge
git checkout -b new-branch-name- Edit
git commit -am 'Commit message'git push -u origin new-branch-nameto push new branch to bitbucket for first time (subsequent times can usegit push)git checkout mastergit merge new-branch-name
Heroku
heroku loginheroku keys:addheroku creategit push heroku masterheroku openheroku logs
Generate
rails generate controller ControllerName action1 action2rails destroy controller ControllerName action1 action2to reverse the controller generationrails generate model User name:string email:stringrails destroy model Userto reverse the model generationrake db:migraterake db:rollbackto rollback the migrationrake db:migrate VERSION=0to rollback to the version number specified (0 = right to the beginning)
- ← Previous
Oreilly Software Architecture Fundamentals - Next →
Grid systems