Last active
January 21, 2016 06:43
-
-
Save manters2000/1803365be5b99c6ddc62 to your computer and use it in GitHub Desktop.
Common Rails Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Common Rails Commands | |
rails new app | |
rails server | |
rails generate Scaffold name:string email:string | |
bundle exec rake db:migrate | |
rails console | |
bundle exec rake test | |
bundle exec guard init | |
bundle exec guard | |
rails generate integration_test site_layout # generate integration test like for 'site layout' | |
rails generate controller Users new | |
rails destroy controller AccountActivations | |
rails generate model User name:string email:string | |
rails generate uploader Picture | |
bundle exec rake db:migrate | |
bundle exec rake db:migrate:status | |
bundle exec rake db:rollback # undo db migration | |
rails console --sandbox # any modification will be rolled back | |
bundle exec rake test:models # test for models | |
rails generate migration add_index_to_users_email | |
rails generate migration add_password_digest_to_users password_digest:string | |
# Remove/ Reset Database | |
bundle exec rake db:migrate:reset | |
bundle exec rake db:seed # Load sample data from seeds.rb file | |
# do not install gem from production | |
bundle install --without production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment