Created
July 24, 2013 13:16
-
-
Save LaminSanneh/6070486 to your computer and use it in GitHub Desktop.
Ruby on Rails : Useful Commands
This file contains 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
Ruby on Rails Useful Commands | |
//Make sure you have ruby installed to be able to run these commands | |
gem install rails -------- This installs rails for you | |
gem install rails-api -------- This installs rails api gem for creating a restful api oriented app | |
rails new appName -------- Creates a new rails application in the | |
folder with the same name as the app | |
rails new appName -d postgresql -------- Creates a new rails application in the | |
folder with the same name as the app but with a parameter specifying the database type to use | |
rails g/generate scaffold thing thingAttribute1(type defaults to string) thingAttribute2:type(e.g. text,number) -------- Scaffolds a new type of thing in your application(make sure you cd into your app root directory) | |
rake db:create -------- Scans your database.yml file and creates the databases listed there | |
rake db:migrate -------- Creates the tables and columns after you've done a scaffold | |
rails s/server -------- Starts a new rails server ready to serve html files for your new app | |
bundle install -------- Installs the packages/bundles in you Gemfile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment