Last active
December 12, 2015 07:28
-
-
Save anilmuppalla/4736295 to your computer and use it in GitHub Desktop.
Summary of railstutorial.org
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
| #Install RVM with ruby: | |
| \curl -L https://get.rvm.io | bash -s stable --ruby | |
| #Additionally with rails: | |
| \curl -L https://get.rvm.io | bash -s stable --rails | |
| #since Heroku as on Feb, 2012 supports Ruby 1.9.2 and Rails 3 | |
| #we need to switch to these versions, by creating a gemset. | |
| rvm use 1.9.2@rails3tutorial --create --default | |
| #Use scaffold to create a simple application with all MVC controlls; in this case a db table User with name and email as columns. | |
| rails generate scaffold User name:string email:string | |
| #Run the setup (bundle exec - to use the rake version setup in the Gemfile) | |
| bundle exec rake db:migrate | |
| #push to heroku | |
| git push heroku master | |
| #to migrate to Heroku | |
| heroku run rake db:migrate | |
| #add the gem rspec-rails to gemfile to integrate rspec tests instead of default unit test | |
| gem 'rspec-rails' | |
| #generate static controllers | |
| rails generate controller StaticPages home help --no-test-framework | |
| #Cleaning up your mess | |
| rails generate controller FooBars baz quux | |
| rails destroy controller FooBars baz quux | |
| rails generate model Foo bar:string baz:integer | |
| rails destroy model Foo | |
| rake db:migrate | |
| rake db:rollback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment