SlideShare a Scribd company logo
1 of 5
RAILS-5.0
NOTES/CHEATSHEET
Manish Sakariya -India
1) Browser sends request to
server for the html page
2) Router routes the request
To the controller of the
Demanded page.
3) A) Controller checks if page
Is available in the view. if yes then send page back to
the server
4) Controller sends
requested page to server
3) B) else controller takes
data from database using
model and send to the
view. page is created in the
view based on the data.
 1) Generate new Rails project (type inside console)
Rails new project_name -d database
example: Rails new myapp –d MYSQL
Extra info…. 1) then-> cd myapp 2) then-> bundle install 3) bundle exec command to check
why command is not working]
 2) Generate new controller (type inside console)
Rails g controller controller_name methodnames..(optional)
example: Rails g controller wecome index
 3) Generate new model (type inside console)
Rails g model model_name columnatme:datatype…
example: Rails g model name:string password:string
 4) Generate migration ( type inside controller)
A) Rails g migration migrationname (simple migration)
Example: rails g migration createtable
B) Rails g migration AddXXXToYYY ( Add column in the table)
Example: rails g migration AddDateToEmployee
C) Rails g migration RemoveXXXFromYYY (Remove column from the table)
Example: rails g migration RemoveDateFromEmployee
5) Go to config/database.yml file. Then set database name ,
username , password and mysql socket name
rake Db:schema:dump
rake db:migrate (will create or modify table according to migration)
6) Go to config/route.rb file. And place universal matching pattern
match ‘controller(/:action(/:id))’ , :via => :get
7) To start rails server : Rails server
To stop rails server : ctrl+c
Controller
Active Record
Database
**CRUD**
Response
Query
Return data
or error
**CRUD** full form
C=CREATE | R=READ|U=UPDATE|D=DELETE
Active Record is a layer of the system
which facilitates the creation and use of
business objects whose data requires
persistent storage to a database

More Related Content

Viewers also liked

Goal Tracker MVP
Goal Tracker MVPGoal Tracker MVP
Goal Tracker MVPNishan Bose
 
Мой любимый спорт
Мой любимый спортМой любимый спорт
Мой любимый спортgexarvest
 
Measurement for Improvement - Management of Acute Kidney Injury in primary c...
Measurement for Improvement - Management of Acute Kidney Injury in primary c...Measurement for Improvement - Management of Acute Kidney Injury in primary c...
Measurement for Improvement - Management of Acute Kidney Injury in primary c...Renal Association
 
Professional Resume of Mia Alexander
Professional Resume of Mia AlexanderProfessional Resume of Mia Alexander
Professional Resume of Mia AlexanderMia Alexander
 
Alcances jurídicos del plan nacional para el buen vivir
Alcances jurídicos del plan nacional para el buen vivirAlcances jurídicos del plan nacional para el buen vivir
Alcances jurídicos del plan nacional para el buen vivirJessica_Viviana_Carrasco
 
Context : The history of English writing
 Context : The history of English writing  Context : The history of English writing
Context : The history of English writing Kim Hutton-Brown
 
Om0010 operations management
Om0010 operations managementOm0010 operations management
Om0010 operations managementconsult4solutions
 
Uf2 practica 1 quim tejedor
Uf2 practica 1 quim tejedorUf2 practica 1 quim tejedor
Uf2 practica 1 quim tejedorquimlh97
 

Viewers also liked (16)

Venkat Resume
Venkat Resume Venkat Resume
Venkat Resume
 
Goal Tracker MVP
Goal Tracker MVPGoal Tracker MVP
Goal Tracker MVP
 
Babyxerocon4
Babyxerocon4Babyxerocon4
Babyxerocon4
 
Мой любимый спорт
Мой любимый спортМой любимый спорт
Мой любимый спорт
 
Measurement for Improvement - Management of Acute Kidney Injury in primary c...
Measurement for Improvement - Management of Acute Kidney Injury in primary c...Measurement for Improvement - Management of Acute Kidney Injury in primary c...
Measurement for Improvement - Management of Acute Kidney Injury in primary c...
 
Professional Resume of Mia Alexander
Professional Resume of Mia AlexanderProfessional Resume of Mia Alexander
Professional Resume of Mia Alexander
 
Syllabus cal.int-2017
Syllabus cal.int-2017Syllabus cal.int-2017
Syllabus cal.int-2017
 
TIME TREX- 01
TIME TREX- 01TIME TREX- 01
TIME TREX- 01
 
2038868 (1)
2038868 (1)2038868 (1)
2038868 (1)
 
Presentación1
Presentación1Presentación1
Presentación1
 
Alcances jurídicos del plan nacional para el buen vivir
Alcances jurídicos del plan nacional para el buen vivirAlcances jurídicos del plan nacional para el buen vivir
Alcances jurídicos del plan nacional para el buen vivir
 
Context : The history of English writing
 Context : The history of English writing  Context : The history of English writing
Context : The history of English writing
 
Om0010 operations management
Om0010 operations managementOm0010 operations management
Om0010 operations management
 
Uf2 practica 1 quim tejedor
Uf2 practica 1 quim tejedorUf2 practica 1 quim tejedor
Uf2 practica 1 quim tejedor
 
Vol6
Vol6Vol6
Vol6
 
Ashu sharma
Ashu sharmaAshu sharma
Ashu sharma
 

Similar to Rails 5 All topic Notes

Ruby onrails overview
Ruby onrails overviewRuby onrails overview
Ruby onrails overviewPiyush Chand
 
Creating a scalable & cost efficient BI infrastructure for a startup in the A...
Creating a scalable & cost efficient BI infrastructure for a startup in the A...Creating a scalable & cost efficient BI infrastructure for a startup in the A...
Creating a scalable & cost efficient BI infrastructure for a startup in the A...vcrisan
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handsonPrashant Kumar
 
Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Heng-Yi Wu
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desaijinaldesailive
 
Pega Mock questions
Pega Mock questionsPega Mock questions
Pega Mock questionsAshock Roy
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise Group
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh Kushwah
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questionsGhazi Anwar
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questionsBilam
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8Thomas Robbins
 
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engineDaniel Fisher
 
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSouth Tyrol Free Software Conference
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 

Similar to Rails 5 All topic Notes (20)

L10 Web Programming
L10 Web ProgrammingL10 Web Programming
L10 Web Programming
 
Ruby onrails overview
Ruby onrails overviewRuby onrails overview
Ruby onrails overview
 
Creating a scalable & cost efficient BI infrastructure for a startup in the A...
Creating a scalable & cost efficient BI infrastructure for a startup in the A...Creating a scalable & cost efficient BI infrastructure for a startup in the A...
Creating a scalable & cost efficient BI infrastructure for a startup in the A...
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
 
Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104
 
L17 Presentation Layer Design
L17 Presentation Layer DesignL17 Presentation Layer Design
L17 Presentation Layer Design
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
 
Pega Mock questions
Pega Mock questionsPega Mock questions
Pega Mock questions
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application development
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’s
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Asp.net
Asp.netAsp.net
Asp.net
 
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
 
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 

Recently uploaded

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 

Recently uploaded (20)

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 

Rails 5 All topic Notes

  • 2. 1) Browser sends request to server for the html page 2) Router routes the request To the controller of the Demanded page. 3) A) Controller checks if page Is available in the view. if yes then send page back to the server 4) Controller sends requested page to server 3) B) else controller takes data from database using model and send to the view. page is created in the view based on the data.
  • 3.  1) Generate new Rails project (type inside console) Rails new project_name -d database example: Rails new myapp –d MYSQL Extra info…. 1) then-> cd myapp 2) then-> bundle install 3) bundle exec command to check why command is not working]  2) Generate new controller (type inside console) Rails g controller controller_name methodnames..(optional) example: Rails g controller wecome index  3) Generate new model (type inside console) Rails g model model_name columnatme:datatype… example: Rails g model name:string password:string
  • 4.  4) Generate migration ( type inside controller) A) Rails g migration migrationname (simple migration) Example: rails g migration createtable B) Rails g migration AddXXXToYYY ( Add column in the table) Example: rails g migration AddDateToEmployee C) Rails g migration RemoveXXXFromYYY (Remove column from the table) Example: rails g migration RemoveDateFromEmployee 5) Go to config/database.yml file. Then set database name , username , password and mysql socket name rake Db:schema:dump rake db:migrate (will create or modify table according to migration) 6) Go to config/route.rb file. And place universal matching pattern match ‘controller(/:action(/:id))’ , :via => :get 7) To start rails server : Rails server To stop rails server : ctrl+c
  • 5. Controller Active Record Database **CRUD** Response Query Return data or error **CRUD** full form C=CREATE | R=READ|U=UPDATE|D=DELETE Active Record is a layer of the system which facilitates the creation and use of business objects whose data requires persistent storage to a database