Creating new rails project

$ rails new projectname

After that, open the folder, find Gemfile, and copy it.

gem 'rails-footnotes', '~> 5'

Run this in your console after pasting it into Gemfile.

$ bundle install

After running 'bundle install' make sure you run the following to install the appropriate files/dependencies.

$ rails generate rails_footnotes:install

You need to run this on your console in order to install the rails footnotes in your project. After finishing the installation, you can now start the server.

$ rails s or rails server -b 0.0.0.0 or rails s -b 0.0.0.0

If your server is already started, go to your designated server or open server

Creating new controllers

rails generate controller <ControllerName>

Example: $ rails g controller Users

You can also generate a controller with methods.

rails generate controller <ControllerName> <methods space separated>

Example: $ rails g controller Users index

For more information, read more:

Rails way of Routing

Description URL controller#method HTTP Verb
A page that displays all the products. /products products#index GET
A page that allows the user to add a new product /products/new products#new GET
A URL that processes information submitted from the new page to create a product /products products#create POST
A page that displays information for the product with an id of 2 /products/2 products#show GET
A page that allows the user to edit existing product information /products/2/edit products#edit GET
A URL that processes information submitted from the edit page to update a product /products/2 products#update PATCH/PUT
A URL that allows a product to be deleted /products/2 products#destroy DELETE

Creating new model

$ rails g model User first_name:string last_name:string email:string password:string age:integer

After creating new model run this code

$ rake db:migrate OR rails db:migrate

ActiveRecord supports many different data types: See more

Relationship Sample

$ rails g model Message content:text user:references