my ruby rails cheat sheet



Skip actions 

skip_before_action :verify_authenticity_token
protect_from_forgery :except => :create 

Create an API project 

rails new my_api --api

Create a normal project 

rails new blog

Create Model 

$ bin/rails generate model Article title:string text:text

Start server 

bin/rails server

Controller 

bin/rails generate controller Welcome index

Running Migration 

rails db:migrate

Rollback Migration 

rake db:rollback STEP=1

Comments

Popular posts from this blog

ionic2 cordova build android - Unable resolve gradle 2.2.3

A quick tutorial for OWASP ZAP tool for beginners