# Common Rails Commands ## rake db:create - Creates all the databases specified in config/database.yml ## rake db:migrate - Run existing migrations in db/migrate - Generates the schema.rb file ## rake db:seed - Runs db/seeds.rb ## rake db:drop - Drop the current environment’s database ## rake db:drop:all - Drop all databases listed in config/database.yml ## rake db:migrate:reset - Drop tables, create tables, rerun all migrations. ## rake routes - List all available routes, defined in config/routes.rb ## rails generate migration - syntax: `rails g migration ModelName title:string` ## rails generate model - syntax: `rails g model ModelName` ## rails console - The rails version of pry. - Useful for viewing data in db, and testing model methods ## rails new - create a new rails application - use `rails new AppName -d postgresql` ## rails server - Starts the server (ctrl-c to stop)