SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Ruby on Rails
B. Meyer, P. Tokarev
Web Technologies – Ruby on Rails – WS 2010/111
The slides are licensed under a
Creative Commons Attribution 3.0 License
Content
1. Introduction
2. Main Concepts
1. MVC
2. Convention over Configuration
3. Generation of code
3. Movie Review Demo
4. Additional Features
Web Technologies2
What is Ruby?
Open‐source Programming Language
Platform independent
Object‐Oriented
Supports multiple paradigms e.g.
Functional Programming
Duck‐Typing
Metaprogramming
First Version (0.95) made public in Dec 1995
Web Technologies3
Some Ruby Paradigms: Objects
In Ruby everything is an object
Allows  simple loops
For‐loop:  
generates
Foreach‐loop: 
generates
4 Web Technologies
Hello World
Hello World
2.times{puts “Hello World“}
array = [1, ‘hi‘,  3.14]
array.each {|item| puts item }
1
‘hi‘
3.14
Some Ruby Paradigms: Duck‐Typing
Duck‐Typing allows usage of class‐members only by knowing 
their name
5 Web Technologies
class Duck 
def description
“A grey duck”
end
def makeNoise
“Quaak!“
end
end
class Cow
def description
“A big cow”
end
def makeNoise
“Moo!“
end
end
def animalSound animal
puts animal.description + “ makes “ + animal.makeNoise
end
“animalSound Duck.new”  generates “A grey duck makes Quaak!”
“animalSound Cow.new”  generates “A big cow makes Moo!”
Some Ruby Paradigms: Metaprogramming
Metaprogramming allows code to write other code at
runtime
Some possibilities:
Redefine classes and methods
Dynamically creating classes
Automatic object serialization
Modifying method calls
6 Web Technologies
What is Ruby on Rails?
Open‐source Web Application 
Framework written in Ruby
It was published by 
David Heinemeyer Hanson
Rails was invented for an 
Application named „Basecamp“
Rails was first presented in 2004
Web Technologies7
History
Version 1 was published on December 13th 2005
Version 2.0 was published on March 15th 2009
Had more than a hundred improvements e.g.:
XML deserialization
Debugger
Performance improvements
Version 3.0 was published on August 29th 2010
Merges merb with Rails → one big Ruby‐based Framework
Web Technologies8
Principles
Ruby on Rails uses two main priciples:
Convention over Configuration 
→ Easy to set up
Don‘t repeat yourself (DRY)
→  Rapid development
Web Technologies9
Image:
Content
1. Introduction
2. Main Concepts
1. MVC
2. Convention over Configuration
3. Generation of code
3. Movie Review Demo
4. Additional Features
Web Technologies10
MVC inside Rails
Web Technologies11
Controller
View
Model
Client
Server
Dispatcher
ActionController
ActionView ActiveRecord
DBMS
request
forward
request
load
request
respond
redirect
render
querydata
display
Convention over Configuration
Web Technologies12
Model
movie
Controller
movies_controller
show edit
Table in DB
movies
new
Model
Controller
View
Generation of code
Rails command: rails generate scaffold movie
Table in database
Folder and file structure for model, view and 
controller
Creates all 'CRUD' actions for controller
Creates all 'CRUD' views
1 line of code generates more then 100 lines of code
Web Technologies13
Content
1. Introduction
2. Main Concepts
1. MVC
2. Convention over Configuration
3. Generation of code
3. Movie Review Demo
4. Additional Features
Web Technologies14
Movie Review Demo
Create Project
Web Technologies15
Movie Review Demo
Create Project
Use scaffolding
Web Technologies16
Movie Review Demo
Create Project
Use scaffolding
Add new attributes to models
Web Technologies17
Movie Review Demo
Create Project
Use scaffolding
Add new attributes to models
Add new model
Web Technologies18
Movie Review Demo
Create Project
Use scaffolding
Add new attributes to models
Add new model
Create one to many relation
Web Technologies19
Movie
id :int
title :string
...
Comment
id :int
text :text
movie_id :int
Content
1. Introduction
2. Main Concepts
1. MVC
2. Convention over Configuration
3. Generation of code
3. Movie Review Demo
4. Additional Features
Web Technologies20
More features
Session management
Available for different languages (e.g. Java)
Various DB support 
MySQL, Postgres, Oracle etc.
Partials 
Code that belongs to several documents  DRY
Tests 
Rails creates test files automatically
Layouts
Customize look and feel
Plug‐ins
Open‐source  many Plug‐ins are available
Web Technologies21
Implemented in Rails
Web Technologies22
Summary
Rails is written in Ruby
Ruby != Rails
Open‐source 
Web application framework
Convention over Configuration
Model‐View‐Controller (MVC)
Don’t repeat yourself (DRY)
Additional features available
23 Web Technologies

Más contenido relacionado

Similar a Rails Framework

Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
myuser
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash course
andreanodari
 

Similar a Rails Framework (20)

Ruby on Rails All Hands Meeting
Ruby on Rails All Hands MeetingRuby on Rails All Hands Meeting
Ruby on Rails All Hands Meeting
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
 
Socket Programming In Python
Socket Programming In PythonSocket Programming In Python
Socket Programming In Python
 
Ruby On Rails Overview
Ruby On Rails OverviewRuby On Rails Overview
Ruby On Rails Overview
 
Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets Cocoa
 
ruby pentest
ruby pentestruby pentest
ruby pentest
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby Developers
 
Ruby Introduction
Ruby IntroductionRuby Introduction
Ruby Introduction
 
Initiation à Ruby on Rails
Initiation à Ruby on RailsInitiation à Ruby on Rails
Initiation à Ruby on Rails
 
IronRuby for the .NET Developer
IronRuby for the .NET DeveloperIronRuby for the .NET Developer
IronRuby for the .NET Developer
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash course
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
RubyMotion Introduction
RubyMotion IntroductionRubyMotion Introduction
RubyMotion Introduction
 
Intro for RoR
Intro for RoRIntro for RoR
Intro for RoR
 
Ruby and Security
Ruby and SecurityRuby and Security
Ruby and Security
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Rails Framework