SlideShare une entreprise Scribd logo
1  sur  27
Ruby On Rails
Building Web Applications Is Fun!
What is Ruby on Rails?

Rails is a full-stack framework for developing
 database-backed web applications according
       to the Model-View-Control pattern.

– www.rubyonrails.org - Ruby on Rails official site
RoR Trivia

• Written in Ruby
• Creator of Ruby on Rails
    – David Heinemeier Hansson
•   Birth: July 2004
•   Latest: 2.1.1: 4 September 2008
•   Based on SmallTalk, Perl, Lisp
•   Not strongly typed
What is Ruby?

 Dynamic, high level, interpreted, pure object-
             orientated language.

“Ruby is designed to make programmers happy”
         Yukihiro Matsumoto aka Matz
Ruby Trivia

• Creator of Ruby
  – Yukihiro Matsumoto aka Matz
• Birthday: 24 February 1993
• Originated in Japan and Rapidly
  Gaining Mindshare in US and Europe.
Design Principles
Design Principles

                    Model - View - Controller

    • Separate data (model) from user interface (view)

    • Model
         – data access and business logic
         – independent of the view and controller
    • View
         – data presentation and user interaction
         – read-only access to the model
    • Controller
         – handling events
         – operating on model and view
Design Principles

                    Database Persistence

    • OR mapping
         – Active Record design pattern
    • migrations
         – incremental schema management
    • multiple db adapters
         – MySQL, PostgreSQL, SQLite, SQL Server, IBM DB2,
           Informix, Oracle
Design Principles

                    Full Stack Framework

    •   MVC suite
    •   built-in webserver
    •   default db adapter
    •   AJAX, web services, email
    •   test framework
    •   plugins
Design Principles

                    Convention over Configuration

    • fixed directory structure
         – everything has its place – source files, libs, plugins,
           database files, documentation etc
    • file naming conventions
         – e.g. camel case class name, underscore file name
    • database naming conventions
         – table names, primary and foreign keys
    • standard configuration files
         – e.g. database connections, environment setting definitions
           (development, production, test)
Design Principles

                    DRY - Don’t Repeat Yourself

    • reusing code
         – e.g. view elements
    • reusing data
         – e.g. no need to declare table field names – can be read
           from the database
    • making each line of code work harder
         – e.g. mini languages for specific domains
    • object-relational mapping
    • metaprogramming
         – dynamically created methods
MVC Architecture
MVC Architecture

                   MVC Architecture
MVC Architecture

                   Model - ActiveRecord

    • Object Relational Mapping
        – “ActiveRecord”
    • Less Database “glue” Code
    • Logging for Performance Checking
MVC Architecture

                        Model : Rules

    • Table Names
        – Plurals
    • Attribute Names
        – id for primary key in table
        – table_id for foreign key in other table
MVC Architecture

                       View - ActionView

    • multiple template types
        – oldest and basic: erb (embedded ruby), similar to e.g. jsp
        – remote javascript templates
        – xml templates
    • easy reuse of view elements
        – file inclusion – layouts, templates, partials
        – multiple standard "helpers" – common html element
          generators (e.g. form elements, paginators)
    • easy AJAX integration
MVC Architecture

                   Controller : ActionController

    • Method name matches view folder
        – users_controller.rb works for
          /views/users/***.rhtml
        – called “actions”
        – all view’s methods will sit there
    • Ability to
        – CRUD
        – Flash
        – Redirect
Some Comparisons
RoR vs. Java
 Comparison of Rails and J2EE stacks
Usage & Support
Usage & Support

                   Web Servers

    •   Lighttpd
    •   Mongrel
    •   WEBrick
    •   Apache
Usage & Support

                      RoR Databases

    •   Mysql
    •   Oracle
    •   Postgre Sql
    •   SqlLite
Usage & Support

                  Websites on Rails
Usage & Support

                  Companies Using Rails
References
•   www.slideshare.net
•   www.youtube.com
•   www.google.com
•   http://www.netbeans.org/kb/docs/ruby/rapid-rub
•   http://guides.rails.info/getting_started.html
•   www.rubyonrails.org
•   http://www.tutorialspoint.com/ruby-on-rails-2.1
Thank You.!!

Contenu connexe

Tendances

Introduction to Browser DOM
Introduction to Browser DOMIntroduction to Browser DOM
Introduction to Browser DOM
Siva Arunachalam
 
Open Source CMS Playroom
Open Source CMS PlayroomOpen Source CMS Playroom
Open Source CMS Playroom
librarywebchic
 

Tendances (20)

Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
 
Shooting rabbits with sling
Shooting rabbits with slingShooting rabbits with sling
Shooting rabbits with sling
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
9 Months Web Development Diploma Course in North Delhi
9 Months Web Development Diploma Course in North Delhi9 Months Web Development Diploma Course in North Delhi
9 Months Web Development Diploma Course in North Delhi
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 Presentation
 
Web Ninja
Web NinjaWeb Ninja
Web Ninja
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
Keystone.js 101
Keystone.js 101Keystone.js 101
Keystone.js 101
 
A Custom Drupal Theme in 40 Minutes
A Custom Drupal Theme in 40 MinutesA Custom Drupal Theme in 40 Minutes
A Custom Drupal Theme in 40 Minutes
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Mastering asp.net mvc - Dot Net Tricks
Mastering asp.net mvc - Dot Net TricksMastering asp.net mvc - Dot Net Tricks
Mastering asp.net mvc - Dot Net Tricks
 
Psd 2 Drupal
Psd 2 DrupalPsd 2 Drupal
Psd 2 Drupal
 
Start using less css
Start using less cssStart using less css
Start using less css
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
Alfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy BehavioursAlfresco Content Modelling and Policy Behaviours
Alfresco Content Modelling and Policy Behaviours
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101October 2014 - USG Rock Eagle - Sass 101
October 2014 - USG Rock Eagle - Sass 101
 
Introduction to Browser DOM
Introduction to Browser DOMIntroduction to Browser DOM
Introduction to Browser DOM
 
Open Source CMS Playroom
Open Source CMS PlayroomOpen Source CMS Playroom
Open Source CMS Playroom
 

En vedette (6)

Honeypots
HoneypotsHoneypots
Honeypots
 
Honeypots
HoneypotsHoneypots
Honeypots
 
Honeypot
Honeypot Honeypot
Honeypot
 
Honey Pot
Honey PotHoney Pot
Honey Pot
 
Honeypots
HoneypotsHoneypots
Honeypots
 
Honeypots
HoneypotsHoneypots
Honeypots
 

Similaire à Ruby On Rails

Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
CMC Limited
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
Wen-Tien Chang
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
Wen-Tien Chang
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
Don Demcsak
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
drewz lin
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构
yiditushe
 

Similaire à Ruby On Rails (20)

Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
6 weeks 6 months live project summer industrial training in cmc limited 2012
6 weeks  6 months live project summer industrial training in cmc limited  20126 weeks  6 months live project summer industrial training in cmc limited  2012
6 weeks 6 months live project summer industrial training in cmc limited 2012
 
Client Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsClient Side MVC with Backbone and Rails
Client Side MVC with Backbone and Rails
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content Repositories
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Rails - getting started
Rails - getting startedRails - getting started
Rails - getting started
 
Frameworks Galore: A Pragmatic Review
Frameworks Galore: A Pragmatic ReviewFrameworks Galore: A Pragmatic Review
Frameworks Galore: A Pragmatic Review
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
Full Stack Developer Course | Infinite Graphix Technologies
Full Stack Developer Course | Infinite Graphix TechnologiesFull Stack Developer Course | Infinite Graphix Technologies
Full Stack Developer Course | Infinite Graphix Technologies
 
Melbourne User Group OAK and MongoDB
Melbourne User Group OAK and MongoDBMelbourne User Group OAK and MongoDB
Melbourne User Group OAK and MongoDB
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Demystifying Ruby on Rails
Demystifying Ruby on Rails Demystifying Ruby on Rails
Demystifying Ruby on Rails
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
 
Revision
RevisionRevision
Revision
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构
 

Dernier

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 

Ruby On Rails

  • 1. Ruby On Rails Building Web Applications Is Fun!
  • 2. What is Ruby on Rails? Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern. – www.rubyonrails.org - Ruby on Rails official site
  • 3. RoR Trivia • Written in Ruby • Creator of Ruby on Rails – David Heinemeier Hansson • Birth: July 2004 • Latest: 2.1.1: 4 September 2008 • Based on SmallTalk, Perl, Lisp • Not strongly typed
  • 4. What is Ruby? Dynamic, high level, interpreted, pure object- orientated language. “Ruby is designed to make programmers happy” Yukihiro Matsumoto aka Matz
  • 5. Ruby Trivia • Creator of Ruby – Yukihiro Matsumoto aka Matz • Birthday: 24 February 1993 • Originated in Japan and Rapidly Gaining Mindshare in US and Europe.
  • 6.
  • 8. Design Principles Model - View - Controller • Separate data (model) from user interface (view) • Model – data access and business logic – independent of the view and controller • View – data presentation and user interaction – read-only access to the model • Controller – handling events – operating on model and view
  • 9. Design Principles Database Persistence • OR mapping – Active Record design pattern • migrations – incremental schema management • multiple db adapters – MySQL, PostgreSQL, SQLite, SQL Server, IBM DB2, Informix, Oracle
  • 10. Design Principles Full Stack Framework • MVC suite • built-in webserver • default db adapter • AJAX, web services, email • test framework • plugins
  • 11. Design Principles Convention over Configuration • fixed directory structure – everything has its place – source files, libs, plugins, database files, documentation etc • file naming conventions – e.g. camel case class name, underscore file name • database naming conventions – table names, primary and foreign keys • standard configuration files – e.g. database connections, environment setting definitions (development, production, test)
  • 12. Design Principles DRY - Don’t Repeat Yourself • reusing code – e.g. view elements • reusing data – e.g. no need to declare table field names – can be read from the database • making each line of code work harder – e.g. mini languages for specific domains • object-relational mapping • metaprogramming – dynamically created methods
  • 14. MVC Architecture MVC Architecture
  • 15. MVC Architecture Model - ActiveRecord • Object Relational Mapping – “ActiveRecord” • Less Database “glue” Code • Logging for Performance Checking
  • 16. MVC Architecture Model : Rules • Table Names – Plurals • Attribute Names – id for primary key in table – table_id for foreign key in other table
  • 17. MVC Architecture View - ActionView • multiple template types – oldest and basic: erb (embedded ruby), similar to e.g. jsp – remote javascript templates – xml templates • easy reuse of view elements – file inclusion – layouts, templates, partials – multiple standard "helpers" – common html element generators (e.g. form elements, paginators) • easy AJAX integration
  • 18. MVC Architecture Controller : ActionController • Method name matches view folder – users_controller.rb works for /views/users/***.rhtml – called “actions” – all view’s methods will sit there • Ability to – CRUD – Flash – Redirect
  • 22. Usage & Support Web Servers • Lighttpd • Mongrel • WEBrick • Apache
  • 23. Usage & Support RoR Databases • Mysql • Oracle • Postgre Sql • SqlLite
  • 24. Usage & Support Websites on Rails
  • 25. Usage & Support Companies Using Rails
  • 26. References • www.slideshare.net • www.youtube.com • www.google.com • http://www.netbeans.org/kb/docs/ruby/rapid-rub • http://guides.rails.info/getting_started.html • www.rubyonrails.org • http://www.tutorialspoint.com/ruby-on-rails-2.1