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

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Último (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

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/