SlideShare a Scribd company logo
Ruby on Rails Building Web Applications Is Fun Again!
What is Ruby on Rails? Web application framework written in Ruby Ruby is an Object Oriented scripting language Model-view-controller Database agnostic Open source Lots of nice tools, classes and methods to make development easier
The Rails Way DRY (Don’t Repeat Yourself) Convention over configuration Baked in testing Minimal code with maximum effect
Installing Ruby, Gem and Rails Install Ruby OCI8 Driver Connect using TNSNAMES.ORA Connect using InstantClient and a URL More information on wiki.rubyonrails.com Getting Started
Rails on Oracle Key generation assumes sequences for each table with the name ${table_name}_seq Sequence name can be changed using ActiveRecord::Base.set_sequence_name Timezones and sub-second precision not supported More info:  http://wiki.rubyonrails.com/rails/pages/Oracle
Building Your First App Create a new Rails app by typing: rails myapp Edit the config/database.yml Generate a model using: script/generate model MyModel Creating a model creates a class and a migration
ActiveRecord Conventions Naming convention simplifies development and encourages good database design Tables are plural, models are singular Example: Model: LineItem Table: line_items Handles non-regular pluralization such as Person/people Can be overridden, although this complicates things for the developer
Database Migrations Database agnostic means of defining schema Lowest-common-denominator approach Ruby code with full access to ActiveRecord Methods for creating, altering and dropping tables, columns and indexes Can execute arbitrary SQL with ‘execute’ method
ActiveRecord Models Object/Relational Mapping Model classes extend from ActiveRecord::Base ActiveRecord::Base provides: Database agnostic record creation, finding, saving and removal Data validation methods Relationships All in an easy to use package Rails encourages keeping business logic in the model where it belongs AR can be used outside of web applications
Views Responsible for creating part or all of the page displayed in a browser By default uses ERb (Embedded Ruby) Other views include ‘builders’ for XML documents or RJS templates to generate JavaScript for AJAX driven views Includes elegant means for including helper functions for rendering Supports partials and components
Controllers Generate controllers with script/generate controller MyController Controllers tie the view to the model through actions Controllers also have access to “helpers” Designed for people-friendly URLs Provides caching, session management, query parsing, cookie management, pagination
ActiveRecord Relationships  Relationships are through primary keys Supported relationship types: belongs_to (book belongs to author) has_one (book has one publisher) has_many (book has many pages) has_and_belongs_to_many (book has and belongs to many readers) has_many :through (book has many contributors through contributions)
ActiveRecord Validation validates_presence_of validates_uniqueness_of validates_confirmation_of validates_acceptance_of validates_associated validates_each validates_format_of, _length_of validates_exclusion_of, _inclusion_of
More ActiveRecord Acts As acts_as_list (position) acts_as_tree (parent_id) Aggregations composed_of Callbacks Full lifecycle Before and after validation, creation, saving, destroying Calculations average, count, maximum, minimum, sum
Just When You Thought You Had Enough ActiveRecord Callback objects Observers Façade columns Object-level transaction management Magic column names created_on, created_at, updated_on, updated_at auto timestamping and dating lock_version and optimistic locking type for single table inheritence xxx_count counter cache
Other Stuff ActionMailer for sending mail messages ActionView helpers Form helpers Asset tags Javascript support (yummy AJAX!) Pagination Text helpers ActionWebService Ruby language extensions Breakpoint and debugging
Where To Go Next? http://www.rubyonrails.com / http://api.rubyonrails.com / http://wiki.rubyonrails.com/ Agile Web Development with Rails http://www.ruby-doc.org/  for Ruby Programming Ruby IRC, Mailing Lists, Seth Ladd’s brain

More Related Content

PDF
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
PDF
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon
 
PPTX
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Fabio Franzini
 
PPTX
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
 
PDF
Modern Architectures with Spring and JavaScript
martinlippert
 
PDF
[2015/2016] Backbone JS
Ivano Malavolta
 
PDF
tTecniche di sviluppo mobile per share point 2013 e office 365
Fabio Franzini
 
PPTX
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Fabio Franzini
 
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
 
Modern Architectures with Spring and JavaScript
martinlippert
 
[2015/2016] Backbone JS
Ivano Malavolta
 
tTecniche di sviluppo mobile per share point 2013 e office 365
Fabio Franzini
 
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 

What's hot (19)

PDF
JAX 2012: Moderne Architektur mit Spring und JavaScript
martinlippert
 
PPTX
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
PDF
HTML CSS JavaScript jQuery Training
ubshreenath
 
PDF
HTML5: the new frontier of the web
Ivano Malavolta
 
PPTX
Programming is Fun with ASP.NET MVC
Ian Carnaghan
 
PPTX
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
Mark Rackley
 
PDF
Berlin.JAR: Web future without web frameworks
Stephan Schmidt
 
PPTX
Industrial training seminar ppt on asp.net
Pankaj Kushwaha
 
PPTX
SPTechCon - Share point and jquery essentials
Mark Rackley
 
PPTX
Transform SharePoint default list forms with HTML, CSS and JavaScript
John Calvert
 
PPTX
HTL(Sightly) - All you need to know
Prabhdeep Singh
 
PPTX
Angular jS Introduction by Google
ASG
 
PPT
06 Javascript
Herman Tolle
 
PDF
[2015/2016] JavaScript
Ivano Malavolta
 
PDF
Modern development paradigms
Ivano Malavolta
 
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
PDF
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
Kunal Ashar
 
PPT
SD Forum Java SIG - Service Oriented UI Architecture
Jeff Haynie
 
PPTX
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
martinlippert
 
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
HTML CSS JavaScript jQuery Training
ubshreenath
 
HTML5: the new frontier of the web
Ivano Malavolta
 
Programming is Fun with ASP.NET MVC
Ian Carnaghan
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
Mark Rackley
 
Berlin.JAR: Web future without web frameworks
Stephan Schmidt
 
Industrial training seminar ppt on asp.net
Pankaj Kushwaha
 
SPTechCon - Share point and jquery essentials
Mark Rackley
 
Transform SharePoint default list forms with HTML, CSS and JavaScript
John Calvert
 
HTL(Sightly) - All you need to know
Prabhdeep Singh
 
Angular jS Introduction by Google
ASG
 
06 Javascript
Herman Tolle
 
[2015/2016] JavaScript
Ivano Malavolta
 
Modern development paradigms
Ivano Malavolta
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
SOFEA: Service Oriented Front End Architecture, Next Gen Web Architecture for...
Kunal Ashar
 
SD Forum Java SIG - Service Oriented UI Architecture
Jeff Haynie
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 
Ad

Viewers also liked (20)

PDF
Arr johnstone-vivaldi-double cello-concerto-soloist_parts
OsKr Dueñas Niño
 
ODP
Presentacio dimarts
Andreu Ibanez Sert
 
DOC
Zaid Detail CV
zaid alam
 
PPTX
NXT
Andres Blanco
 
PPT
Tocame
chiquitita_roque
 
ODP
Assignment 14 representation
Ashley Goodall
 
PPT
Eilot
want2belive99
 
PPT
13 Phrases
Andrew Isles
 
PPT
Zoekt en gij zult vinden!
johndog
 
ODP
Assignment 14 representation
Ashley Goodall
 
PDF
Canon in-d
OsKr Dueñas Niño
 
DOCX
Practica1
Fabian Ortiz Garcia
 
PPT
Meet the Players
shyattpentz
 
PPT
fall 2006 site conditions surveys lecture
Kazys Varnelis
 
PPTX
Rosa Galicia - Economia, objeto y metodo
rositagalicia
 
PPTX
Yaraikellyn peraza
Yaraikellyn
 
PPTX
Newsletter
cat2504
 
PPTX
Vanessa jimenez
vanessa jimenez
 
PDF
Flyer
Chad Hutchins
 
Arr johnstone-vivaldi-double cello-concerto-soloist_parts
OsKr Dueñas Niño
 
Presentacio dimarts
Andreu Ibanez Sert
 
Zaid Detail CV
zaid alam
 
Assignment 14 representation
Ashley Goodall
 
13 Phrases
Andrew Isles
 
Zoekt en gij zult vinden!
johndog
 
Assignment 14 representation
Ashley Goodall
 
Canon in-d
OsKr Dueñas Niño
 
Meet the Players
shyattpentz
 
fall 2006 site conditions surveys lecture
Kazys Varnelis
 
Rosa Galicia - Economia, objeto y metodo
rositagalicia
 
Yaraikellyn peraza
Yaraikellyn
 
Newsletter
cat2504
 
Vanessa jimenez
vanessa jimenez
 
Ad

Similar to Ruby on Rails: Building Web Applications Is Fun Again! (20)

PPTX
Ruby on rails for beginers
shanmukhareddy dasi
 
PPT
Ruby On Rails
guest4faf46
 
PDF
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
 
PDF
Lecture #5 Introduction to rails
Evgeniy Hinyuk
 
PDF
Ruby On Rails
Balint Erdi
 
PPT
Ruby On Rails
Gautam Rege
 
PDF
Getting Started with Rails
Basayel Said
 
DOCX
Ruby on Rails
Sadakathullah Appa College
 
PDF
Introduction to Ruby on Rails
Agnieszka Figiel
 
PDF
Ruby on rails RAD
Alina Danila
 
PPT
MVC Demystified: Essence of Ruby on Rails
codeinmotion
 
PDF
Ruby Rails Web Development
Sonia Simi
 
PPTX
Beginners' guide to Ruby on Rails
Victor Porof
 
PPT
Intro to Ruby on Rails
Mark Menard
 
PPT
Jasig Rubyon Rails
Paul Pajo
 
PPTX
Server-side Web development via Ruby on Rails
g3ppy
 
PDF
Software development - the java perspective
Alin Pandichi
 
PPTX
The web as it should be
thebeebs
 
PDF
Ruby On Rails
anides
 
PPT
Jasig rubyon rails
_zaMmer_
 
Ruby on rails for beginers
shanmukhareddy dasi
 
Ruby On Rails
guest4faf46
 
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
 
Lecture #5 Introduction to rails
Evgeniy Hinyuk
 
Ruby On Rails
Balint Erdi
 
Ruby On Rails
Gautam Rege
 
Getting Started with Rails
Basayel Said
 
Introduction to Ruby on Rails
Agnieszka Figiel
 
Ruby on rails RAD
Alina Danila
 
MVC Demystified: Essence of Ruby on Rails
codeinmotion
 
Ruby Rails Web Development
Sonia Simi
 
Beginners' guide to Ruby on Rails
Victor Porof
 
Intro to Ruby on Rails
Mark Menard
 
Jasig Rubyon Rails
Paul Pajo
 
Server-side Web development via Ruby on Rails
g3ppy
 
Software development - the java perspective
Alin Pandichi
 
The web as it should be
thebeebs
 
Ruby On Rails
anides
 
Jasig rubyon rails
_zaMmer_
 

Recently uploaded (20)

PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Doc9.....................................
SofiaCollazos
 
PPT
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
PDF
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PPTX
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Doc9.....................................
SofiaCollazos
 
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
This slide provides an overview Technology
mineshkharadi333
 

Ruby on Rails: Building Web Applications Is Fun Again!

  • 1. Ruby on Rails Building Web Applications Is Fun Again!
  • 2. What is Ruby on Rails? Web application framework written in Ruby Ruby is an Object Oriented scripting language Model-view-controller Database agnostic Open source Lots of nice tools, classes and methods to make development easier
  • 3. The Rails Way DRY (Don’t Repeat Yourself) Convention over configuration Baked in testing Minimal code with maximum effect
  • 4. Installing Ruby, Gem and Rails Install Ruby OCI8 Driver Connect using TNSNAMES.ORA Connect using InstantClient and a URL More information on wiki.rubyonrails.com Getting Started
  • 5. Rails on Oracle Key generation assumes sequences for each table with the name ${table_name}_seq Sequence name can be changed using ActiveRecord::Base.set_sequence_name Timezones and sub-second precision not supported More info: http://wiki.rubyonrails.com/rails/pages/Oracle
  • 6. Building Your First App Create a new Rails app by typing: rails myapp Edit the config/database.yml Generate a model using: script/generate model MyModel Creating a model creates a class and a migration
  • 7. ActiveRecord Conventions Naming convention simplifies development and encourages good database design Tables are plural, models are singular Example: Model: LineItem Table: line_items Handles non-regular pluralization such as Person/people Can be overridden, although this complicates things for the developer
  • 8. Database Migrations Database agnostic means of defining schema Lowest-common-denominator approach Ruby code with full access to ActiveRecord Methods for creating, altering and dropping tables, columns and indexes Can execute arbitrary SQL with ‘execute’ method
  • 9. ActiveRecord Models Object/Relational Mapping Model classes extend from ActiveRecord::Base ActiveRecord::Base provides: Database agnostic record creation, finding, saving and removal Data validation methods Relationships All in an easy to use package Rails encourages keeping business logic in the model where it belongs AR can be used outside of web applications
  • 10. Views Responsible for creating part or all of the page displayed in a browser By default uses ERb (Embedded Ruby) Other views include ‘builders’ for XML documents or RJS templates to generate JavaScript for AJAX driven views Includes elegant means for including helper functions for rendering Supports partials and components
  • 11. Controllers Generate controllers with script/generate controller MyController Controllers tie the view to the model through actions Controllers also have access to “helpers” Designed for people-friendly URLs Provides caching, session management, query parsing, cookie management, pagination
  • 12. ActiveRecord Relationships Relationships are through primary keys Supported relationship types: belongs_to (book belongs to author) has_one (book has one publisher) has_many (book has many pages) has_and_belongs_to_many (book has and belongs to many readers) has_many :through (book has many contributors through contributions)
  • 13. ActiveRecord Validation validates_presence_of validates_uniqueness_of validates_confirmation_of validates_acceptance_of validates_associated validates_each validates_format_of, _length_of validates_exclusion_of, _inclusion_of
  • 14. More ActiveRecord Acts As acts_as_list (position) acts_as_tree (parent_id) Aggregations composed_of Callbacks Full lifecycle Before and after validation, creation, saving, destroying Calculations average, count, maximum, minimum, sum
  • 15. Just When You Thought You Had Enough ActiveRecord Callback objects Observers Façade columns Object-level transaction management Magic column names created_on, created_at, updated_on, updated_at auto timestamping and dating lock_version and optimistic locking type for single table inheritence xxx_count counter cache
  • 16. Other Stuff ActionMailer for sending mail messages ActionView helpers Form helpers Asset tags Javascript support (yummy AJAX!) Pagination Text helpers ActionWebService Ruby language extensions Breakpoint and debugging
  • 17. Where To Go Next? http://www.rubyonrails.com / http://api.rubyonrails.com / http://wiki.rubyonrails.com/ Agile Web Development with Rails http://www.ruby-doc.org/ for Ruby Programming Ruby IRC, Mailing Lists, Seth Ladd’s brain