SlideShare a Scribd company logo
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

Venkat Resume
Venkat Resume Venkat Resume
Venkat Resume
Venkat Raju
 
Goal Tracker MVP
Goal Tracker MVPGoal Tracker MVP
Goal Tracker MVP
Nishan Bose
 
Babyxerocon4
Babyxerocon4Babyxerocon4
Babyxerocon4
Growthwise
 
Мой любимый спорт
Мой любимый спортМой любимый спорт
Мой любимый спорт
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 Alexander
Mia Alexander
 
Syllabus cal.int-2017
Syllabus cal.int-2017Syllabus cal.int-2017
Syllabus cal.int-2017
Lorena Covarrubias
 
TIME TREX- 01
TIME TREX- 01TIME TREX- 01
TIME TREX- 01
Clarissa Pérez
 
2038868 (1)
2038868 (1)2038868 (1)
2038868 (1)
Daniel Taub
 
Presentación1
Presentación1Presentación1
Presentación1
María Paula Bastidas
 
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
Jessica_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 management
consult4solutions
 
Uf2 practica 1 quim tejedor
Uf2 practica 1 quim tejedorUf2 practica 1 quim tejedor
Uf2 practica 1 quim tejedor
quimlh97
 
Ashu sharma
Ashu sharmaAshu sharma
Ashu sharma
ASHU SHARMA
 

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

L10 Web Programming
L10 Web ProgrammingL10 Web Programming
L10 Web Programming
Ólafur Andri Ragnarsson
 
Ruby onrails overview
Ruby onrails overviewRuby onrails overview
Ruby onrails overview
Piyush 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 handson
Prashant Kumar
 
Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104Ruby on Rails Kickstart 103 & 104
Ruby on Rails Kickstart 103 & 104
Heng-Yi Wu
 
L17 Presentation Layer Design
L17 Presentation Layer DesignL17 Presentation Layer Design
L17 Presentation Layer Design
Ólafur Andri Ragnarsson
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Er. Kamal Bhusal
 
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
jinaldesailive
 
Pega Mock questions
Pega Mock questionsPega Mock questions
Pega Mock questions
Ashock 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 Nagios
Nagios
 
Skillwise - Advanced web application development
Skillwise - Advanced web application developmentSkillwise - Advanced web application development
Skillwise - Advanced web application development
Skillwise Group
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’s
Yogesh Kushwah
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
Bilam
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
Ghazi Anwar
 
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
Antônio Roberto Silva
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
Thomas Robbins
 
Asp.net
Asp.netAsp.net
Asp.net
Naveen Sihag
 
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
Daniel 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 framework
South Tyrol Free Software Conference
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin 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

UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Massimo Talia
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
Unit -II Spectroscopy - EC I B.Tech.pdf
Unit -II Spectroscopy - EC  I B.Tech.pdfUnit -II Spectroscopy - EC  I B.Tech.pdf
Unit -II Spectroscopy - EC I B.Tech.pdf
TeluguBadi
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
Power Electronics- AC -AC Converters.pptx
Power Electronics- AC -AC Converters.pptxPower Electronics- AC -AC Converters.pptx
Power Electronics- AC -AC Converters.pptx
Poornima D
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
OKORIE1
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
wafawafa52
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 

Recently uploaded (20)

UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
Unit -II Spectroscopy - EC I B.Tech.pdf
Unit -II Spectroscopy - EC  I B.Tech.pdfUnit -II Spectroscopy - EC  I B.Tech.pdf
Unit -II Spectroscopy - EC I B.Tech.pdf
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
Power Electronics- AC -AC Converters.pptx
Power Electronics- AC -AC Converters.pptxPower Electronics- AC -AC Converters.pptx
Power Electronics- AC -AC Converters.pptx
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 

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