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

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type