SlideShare una empresa de Scribd logo
1 de 23
Ruby On Rails
Web Application Framework
D. Prabu
Senior Technical Consultant,
Spritle Software PVT LTD,
Chennai.
History
• David Heinemeier Hansson extracted
Ruby on Rails from his work
on BaseCamp, a project management
tool by 37signals.
• Hansson first released Rails as
open source in July 2004.
• Rails 4.0 Final version released.
WAF
• A web application framework (WAF) is a software
framework that is designed to support the development
of dynamic websites, web applications, web services and web
resources.
• Rails is a web-application framework that includes everything
needed to create database-backed web applications according
to the Model-View-Controller (MVC) pattern.
MVC - Rails Architecture
Model (Active Record)
• It is responsible for representing business
data and logic
• It takes how to Write and Read from the
database.
• ORM, is a technique that connects the rich
objects of an application to tables in DB.
View (Layout)
• To generate an output representation to the
user.
• It is composed of “templates”, that are
responsible for providing appropriate
representations of your application’s
resource.
• Templates can come in a variety of formats,
but most view templates are HTML with
embedded Ruby code.
Controller
• It is responsible for handling incoming
HTTP requests and providing a suitable
response.
• Rails controllers can generate HTML,
XML, JSON, PDFs, and more.
In Rails, the Controller and View layers are
handled together by Action Pack.
Rails Strengths
It has grown when it comes to the number of
features allowing developers to achieve more in less time.
• Convention over configuration
 Most web development frameworks for .NET or
Java force you to write pages of configuration code.
Rails doesn't need much configuration.
 Developers to focus on “what they are doing ”
instead of on “how they are doing it” the approach is
meant to boost their productivity.
• DRY concept
 Keep your business logic in one place.
Create a new rails application
$ > rails new blog
ROR Languages used …
Largest sites running in Ruby on Rails
 Twitter
 Github
 Yammer
 Scribd
 Groupon
 Shopify
 Basecamp
Blogs
id title tags
1. Benefits Of Ruby RUBY
2. Mobile Frameworks MOBILE
3. Getting Started with Personal Web Pages WEB
4. Responsive Web Design CSS
5. Practicing Ruby RUBY
Question :
Retrieve a hash of the blog title with id = 3
Blogs
id title tags
1. Benefits Of Ruby RUBY
2. Mobile Frameworks MOBILE
3. Getting Started with Personal Web Pages WEB
4. Responsive Web Design CSS
5. Practicing Ruby RUBY
Question :
Retrieve a hash of the blog title with id = 3
Answer :
Result = { :title => “Getting Started with Personal Web Pages” , :tags=>” WEB” }
result = { :title => “Getting Started with Personal Web Pages” ,
:tags=>” WEB” }
puts result[:title] => “Getting Started with Personal Web Pages”
puts result[:tags] => “WEB”
(or)
puts result.title => “Getting Started with Personal Web Pages”
puts result.tags => “WEB”
HASH
Series of key value pairs
id title tags
1. Benefits Of Ruby RUBY
2. Mobile Frameworks MOBILE
3. Getting Started with Personal
Web Pages
WEB
4. Responsive Web Design CSS
5. Practicing Ruby RUBY
Blogs
b = Blog.find(3)Answer :
Question : Retrieve a hash of the blog title with id = 3
puts b[:title] => “Getting Started with Personal Web Pages”
puts b[:tags] => “WEB”
puts b[:id] => 3
Pluralize
CRUD
Create
Read
Update
Delete
b = Blog.new
b.title= “Ruby Source"
b.save
b = Blog.find(3)
b = Blog.find(3)
b.title= “Web development"
b.Save
b = Blog.find(3)
b.destroy
Create
b = Blog.new
b.title= “Ruby Source“
b.tags = “ruby”
b.save
Alternate Syntax
b = Blog.new(:title=> “Ruby Source", :tags => “ruby")
b.save
(or)
Blog.create(:title => " Ruby Source ", :tags => “ruby")
Read
Blog.find(2) # Returns a single item
Blog.find(3, 4, 5)
Blog.first
# Returns an array
# Returns the first blog
Blog.order(:tags) # All ordered by tags
Blog.last # Returns the last blog
Blog.all
Blog.limit (10)
# Returns all the blogs
# Only 10 blogs
Blog.where(:tags =>“ruby”) # Only blogs by ruby
Blog.where(:tags => “ruby").order(:tags).limit(10)
Update
b = Blog.find(3)
b.title= “Web development"
b.Save
b = Blog.find(2)
b.update_attributes( :title => "Web development",
:tags => “web"
)
(or)
Delete
b = Blog.find(2)
b.destroy
Blog.find(2).destroy
Blog.destroy_all
(or)
(or)
Web Links
• RailsTutorial
• http://ruby.railstutorial.org/
• Rails Guides
• http://guides.rubyonrails.org/
• Rails API Docs
• http://railsapi.com/ and
http://apidock.com/rails
• Rails 3 Free Screencasts
• http://railscasts.com/
Thank You !!
Rails v3.2 Basic Introduction

Más contenido relacionado

La actualidad más candente

Be Happy With Ruby on Rails - Ecosystem
Be Happy With Ruby on Rails - EcosystemBe Happy With Ruby on Rails - Ecosystem
Be Happy With Ruby on Rails - EcosystemLucas Renan
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMake & Build
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on RailsMark Menard
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
How to create a WordPress Site
How to create a WordPress Site How to create a WordPress Site
How to create a WordPress Site MuhammadUsaid2
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SThoughtWorks
 
How to make WordPress your friend
How to make WordPress your friendHow to make WordPress your friend
How to make WordPress your friendKerch McConlogue
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Alan Lok
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery GuideMark Rackley
 
SharePoint 2010 branding
SharePoint 2010 brandingSharePoint 2010 branding
SharePoint 2010 brandingPhil Wicklund
 
SharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink TemplatesSharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink TemplatesMuawiyah Shannak
 
HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks Holger Bartel
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointMark Rackley
 
Umbraco Show & Tell, London 2017
Umbraco Show & Tell, London 2017Umbraco Show & Tell, London 2017
Umbraco Show & Tell, London 2017Andy Butland
 
Things I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web appThings I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web appLim Chee Aun
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebChris Canal
 
BASICS OF WEB DESIGNING AND DEVELOPMENT
BASICS OF WEB DESIGNING AND DEVELOPMENTBASICS OF WEB DESIGNING AND DEVELOPMENT
BASICS OF WEB DESIGNING AND DEVELOPMENTKARTHI THANGAVEL
 

La actualidad más candente (20)

Be Happy With Ruby on Rails - Ecosystem
Be Happy With Ruby on Rails - EcosystemBe Happy With Ruby on Rails - Ecosystem
Be Happy With Ruby on Rails - Ecosystem
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMS
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
Frontender in-2016
Frontender in-2016Frontender in-2016
Frontender in-2016
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
How to create a WordPress Site
How to create a WordPress Site How to create a WordPress Site
How to create a WordPress Site
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G S
 
Rutgers - Active Server Pages
Rutgers - Active Server PagesRutgers - Active Server Pages
Rutgers - Active Server Pages
 
How to make WordPress your friend
How to make WordPress your friendHow to make WordPress your friend
How to make WordPress your friend
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
SharePoint 2010 branding
SharePoint 2010 brandingSharePoint 2010 branding
SharePoint 2010 branding
 
SharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink TemplatesSharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
SharePoint 2013 Client-Side Rendering (CSR) & JSLink Templates
 
HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePoint
 
Umbraco Show & Tell, London 2017
Umbraco Show & Tell, London 2017Umbraco Show & Tell, London 2017
Umbraco Show & Tell, London 2017
 
Things I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web appThings I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web app
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.Web
 
BASICS OF WEB DESIGNING AND DEVELOPMENT
BASICS OF WEB DESIGNING AND DEVELOPMENTBASICS OF WEB DESIGNING AND DEVELOPMENT
BASICS OF WEB DESIGNING AND DEVELOPMENT
 

Destacado

使用Rails best practices做代码审查
使用Rails best practices做代码审查使用Rails best practices做代码审查
使用Rails best practices做代码审查Richard Huang
 
Static Code Analysis For Ruby
Static Code Analysis For RubyStatic Code Analysis For Ruby
Static Code Analysis For RubyRichard Huang
 
Angularjs patterns
Angularjs patternsAngularjs patterns
Angularjs patternsPrabu D
 
Ruby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic IntroductionRuby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic IntroductionPrabu D
 
Ruby Introduction
Ruby IntroductionRuby Introduction
Ruby IntroductionPrabu D
 
rails_best practices_rubykaigi
rails_best practices_rubykaigirails_best practices_rubykaigi
rails_best practices_rubykaigiRichard Huang
 
Rails project code review
Rails project code reviewRails project code review
Rails project code reviewRichard Huang
 

Destacado (7)

使用Rails best practices做代码审查
使用Rails best practices做代码审查使用Rails best practices做代码审查
使用Rails best practices做代码审查
 
Static Code Analysis For Ruby
Static Code Analysis For RubyStatic Code Analysis For Ruby
Static Code Analysis For Ruby
 
Angularjs patterns
Angularjs patternsAngularjs patterns
Angularjs patterns
 
Ruby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic IntroductionRuby 1.9.3 Basic Introduction
Ruby 1.9.3 Basic Introduction
 
Ruby Introduction
Ruby IntroductionRuby Introduction
Ruby Introduction
 
rails_best practices_rubykaigi
rails_best practices_rubykaigirails_best practices_rubykaigi
rails_best practices_rubykaigi
 
Rails project code review
Rails project code reviewRails project code review
Rails project code review
 

Similar a Rails v3.2 Basic Introduction

Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web DevelopmentSonia Simi
 
A Tour of Ruby On Rails
A Tour of Ruby On RailsA Tour of Ruby On Rails
A Tour of Ruby On RailsDavid Keener
 
Building Application with Ruby On Rails Framework
Building Application with Ruby On Rails FrameworkBuilding Application with Ruby On Rails Framework
Building Application with Ruby On Rails FrameworkEdureka!
 
Intro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaIntro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaJason Noble
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails BasicsAmit Solanki
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to railsEvgeniy Hinyuk
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukPivorak MeetUp
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAlessandro DS
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010arif44
 
Ruby on Rails best resources for self
Ruby on Rails best resources for selfRuby on Rails best resources for self
Ruby on Rails best resources for selfDurga Prasad Tumu
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016Justin Gordon
 
RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRuby Bangladesh
 
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...SPTechCon
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails PresentationPaul Pajo
 
www.free-ebooks-download.orgwww.free-ebooks-download.o.docx
www.free-ebooks-download.orgwww.free-ebooks-download.o.docxwww.free-ebooks-download.orgwww.free-ebooks-download.o.docx
www.free-ebooks-download.orgwww.free-ebooks-download.o.docxodiliagilby
 

Similar a Rails v3.2 Basic Introduction (20)

Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web Development
 
Ruby Rails Web Development.pdf
Ruby Rails Web Development.pdfRuby Rails Web Development.pdf
Ruby Rails Web Development.pdf
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
A Tour of Ruby On Rails
A Tour of Ruby On RailsA Tour of Ruby On Rails
A Tour of Ruby On Rails
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
Building Application with Ruby On Rails Framework
Building Application with Ruby On Rails FrameworkBuilding Application with Ruby On Rails Framework
Building Application with Ruby On Rails Framework
 
Intro to Rails Give Camp Atlanta
Intro to Rails Give Camp AtlantaIntro to Rails Give Camp Atlanta
Intro to Rails Give Camp Atlanta
 
Dev streams2
Dev streams2Dev streams2
Dev streams2
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010
 
Ruby on Rails best resources for self
Ruby on Rails best resources for selfRuby on Rails best resources for self
Ruby on Rails best resources for self
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016
 
RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
 
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails Presentation
 
www.free-ebooks-download.orgwww.free-ebooks-download.o.docx
www.free-ebooks-download.orgwww.free-ebooks-download.o.docxwww.free-ebooks-download.orgwww.free-ebooks-download.o.docx
www.free-ebooks-download.orgwww.free-ebooks-download.o.docx
 

Último

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 

Último (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 

Rails v3.2 Basic Introduction

  • 1. Ruby On Rails Web Application Framework D. Prabu Senior Technical Consultant, Spritle Software PVT LTD, Chennai.
  • 2. History • David Heinemeier Hansson extracted Ruby on Rails from his work on BaseCamp, a project management tool by 37signals. • Hansson first released Rails as open source in July 2004. • Rails 4.0 Final version released.
  • 3. WAF • A web application framework (WAF) is a software framework that is designed to support the development of dynamic websites, web applications, web services and web resources. • Rails is a web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.
  • 4. MVC - Rails Architecture
  • 5. Model (Active Record) • It is responsible for representing business data and logic • It takes how to Write and Read from the database. • ORM, is a technique that connects the rich objects of an application to tables in DB.
  • 6. View (Layout) • To generate an output representation to the user. • It is composed of “templates”, that are responsible for providing appropriate representations of your application’s resource. • Templates can come in a variety of formats, but most view templates are HTML with embedded Ruby code.
  • 7. Controller • It is responsible for handling incoming HTTP requests and providing a suitable response. • Rails controllers can generate HTML, XML, JSON, PDFs, and more. In Rails, the Controller and View layers are handled together by Action Pack.
  • 8.
  • 9. Rails Strengths It has grown when it comes to the number of features allowing developers to achieve more in less time. • Convention over configuration  Most web development frameworks for .NET or Java force you to write pages of configuration code. Rails doesn't need much configuration.  Developers to focus on “what they are doing ” instead of on “how they are doing it” the approach is meant to boost their productivity. • DRY concept  Keep your business logic in one place.
  • 10. Create a new rails application $ > rails new blog
  • 11. ROR Languages used … Largest sites running in Ruby on Rails  Twitter  Github  Yammer  Scribd  Groupon  Shopify  Basecamp
  • 12. Blogs id title tags 1. Benefits Of Ruby RUBY 2. Mobile Frameworks MOBILE 3. Getting Started with Personal Web Pages WEB 4. Responsive Web Design CSS 5. Practicing Ruby RUBY Question : Retrieve a hash of the blog title with id = 3
  • 13. Blogs id title tags 1. Benefits Of Ruby RUBY 2. Mobile Frameworks MOBILE 3. Getting Started with Personal Web Pages WEB 4. Responsive Web Design CSS 5. Practicing Ruby RUBY Question : Retrieve a hash of the blog title with id = 3 Answer : Result = { :title => “Getting Started with Personal Web Pages” , :tags=>” WEB” }
  • 14. result = { :title => “Getting Started with Personal Web Pages” , :tags=>” WEB” } puts result[:title] => “Getting Started with Personal Web Pages” puts result[:tags] => “WEB” (or) puts result.title => “Getting Started with Personal Web Pages” puts result.tags => “WEB” HASH Series of key value pairs
  • 15. id title tags 1. Benefits Of Ruby RUBY 2. Mobile Frameworks MOBILE 3. Getting Started with Personal Web Pages WEB 4. Responsive Web Design CSS 5. Practicing Ruby RUBY Blogs b = Blog.find(3)Answer : Question : Retrieve a hash of the blog title with id = 3 puts b[:title] => “Getting Started with Personal Web Pages” puts b[:tags] => “WEB” puts b[:id] => 3 Pluralize
  • 16. CRUD Create Read Update Delete b = Blog.new b.title= “Ruby Source" b.save b = Blog.find(3) b = Blog.find(3) b.title= “Web development" b.Save b = Blog.find(3) b.destroy
  • 17. Create b = Blog.new b.title= “Ruby Source“ b.tags = “ruby” b.save Alternate Syntax b = Blog.new(:title=> “Ruby Source", :tags => “ruby") b.save (or) Blog.create(:title => " Ruby Source ", :tags => “ruby")
  • 18. Read Blog.find(2) # Returns a single item Blog.find(3, 4, 5) Blog.first # Returns an array # Returns the first blog Blog.order(:tags) # All ordered by tags Blog.last # Returns the last blog Blog.all Blog.limit (10) # Returns all the blogs # Only 10 blogs Blog.where(:tags =>“ruby”) # Only blogs by ruby Blog.where(:tags => “ruby").order(:tags).limit(10)
  • 19. Update b = Blog.find(3) b.title= “Web development" b.Save b = Blog.find(2) b.update_attributes( :title => "Web development", :tags => “web" ) (or)
  • 21. Web Links • RailsTutorial • http://ruby.railstutorial.org/ • Rails Guides • http://guides.rubyonrails.org/ • Rails API Docs • http://railsapi.com/ and http://apidock.com/rails • Rails 3 Free Screencasts • http://railscasts.com/