Cheatography
https://cheatography.com
Guidelines to follow when building a Ruby on Rails project
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Installation
Install Ruby (incl. Devkit) |
|
Install Rails |
|
Install git |
|
Verify installed version
Verify Ruby version |
|
Verify Rails version |
|
Verify git version |
|
Create a new project
Select directory |
|
Create new Rails project |
rails new <project_name>
|
Select new project directory |
|
Create and migrate database |
|
Initialize a new Git repository for version control |
|
Add all files Git staging area |
|
Commit staging files to Git repository |
git commit -am "Initial commit"
|
You've now created a project and committed it to a Git repository. Additionally, you could also set up a remote repository on GitHub.
Generate a model
Generate model |
rails generate model <model_name> <attribute1>:<type> <attribute2>:<type>
|
Apply migration and create table |
|
|
|
|