These all do the same thing:
rails new pizza-project --skip-bundle --skip-test-unit --skip-turbolinks --database=postgresql
rails new pizza-project -B -T -d postgresql --skip-turbolinks
rails new pizza-project -BTd postgresql --skip-turbolinksNOTE: This creates the project folder so you don't have to create it beforehand.
cd pizza-projectMake sure your database server (usually Postgres) is running.
rake db:create- Make a route
- Make a controller
rails generate controller YourControllerName action1 another_action more_action
rails generate controller your_controller_name action1 another_action more_actionNOTE: This will add routes automatically. You may want to alter them.
- Your view is already created. Modify it!
- Add
resources :plural_model_nameto routes - Generate the model.
rails generate model YourModelName name:string price:float size:string description:text
- Modify your migration (if necessary).
- rake db:migrate
- Implement actions as needed (
new,create,index, etc.).
Make a new migration:
rails generate migration add_calories_to_salads calories:integer
rake routes - lists current routes