SlideShare a Scribd company logo
1 of 128
Download to read offline
Web Development on Rails
Introducing James and Dana Gray,
this training, and Ruby on Rails
Teachers and Students
We’re going to spend three days working
together, so let’s get to know each other
Who am I?
Who am I?

My name: James Edward Gray II
Who am I?

My name: James Edward Gray II
My experience: I’ve been using Ruby since before
Rails was released and in the last five years I’ve worked
on over 30 shipping Rails applications
Who am I?

My name: James Edward Gray II
My experience: I’ve been using Ruby since before
Rails was released and in the last five years I’ve worked
on over 30 shipping Rails applications
The One True Dessert Food: Angel food cake
Who is my partner?
Who is my partner?

Her name: Dana Gray
Who is my partner?

Her name: Dana Gray
What James thinks about her: She’s cute!
Who is my partner?

Her name: Dana Gray
What James thinks about her: She’s cute!
Her secret: She’s having a baby
Who is my partner?

Her name: Dana Gray
What James thinks about her: She’s cute!
Her secret: She’s having a baby
Ignore what she says about dessert because we
already learned it is: Angel food cake
Your turn!
Your turn!

 Please tell us:
Your turn!

 Please tell us:
   Your name
Your turn!

 Please tell us:
   Your name
   What you know of Ruby/Rails and what you hope to
   learn in this training
Your turn!

 Please tell us:
   Your name
   What you know of Ruby/Rails and what you hope to
   learn in this training
   A fun fact (doesn’t have to be your favorite dessert)
This Training
What the heck are we doing here?
We Will Teach
Web Development
We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
  We will hit the basics
We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
  We will hit the basics
  We will dig deeper in some areas
We Will Teach
Web Development
We are going to teach you how to build complete Web
applications using Rails
It’s a lot to cover and we don’t have time to do it all
  We will hit the basics
  We will dig deeper in some areas
We’re assuming you have minimal HTML, CSS,
JavaScript, and programming knowledge
We Have Hands-on Labs
We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
  You will build a working Rails application over the
  next three days
We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
  You will build a working Rails application over the
  next three days
Make some new friends and work together!
We Have Hands-on Labs
Theory is great, and we will teach that about half of the
time, but you learn Rails by building Rails applications
This training is roughly half lab exercises
  You will build a working Rails application over the
  next three days
Make some new friends and work together!
  I promise you will both learn more that way!
We are Interactive
We are Interactive

 Wake up!
We are Interactive

 Wake up!
 We like questions
We are Interactive

 Wake up!
 We like questions
   Everyone benefits if we turn this into more of a
   discussion and less of a lecture
We are Interactive

 Wake up!
 We like questions
   Everyone benefits if we turn this into more of a
   discussion and less of a lecture
 Help us
We are Interactive

 Wake up!
 We like questions
   Everyone benefits if we turn this into more of a
   discussion and less of a lecture
 Help us
   Please stop us with questions as you have them
Ruby on Rails
What exactly is this “Rails” thing?
Software Moved Online
Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
  Think about how many boxed software applications
  you buy now verses how many Web sites you use
Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
  Think about how many boxed software applications
  you buy now verses how many Web sites you use
  Social networking is huge (Twitter, Facebook, …)
Software Moved Online
Ruby on Rails is a framework for building web
applications (interactive Web sites)
Web development has exploded
  Think about how many boxed software applications
  you buy now verses how many Web sites you use
  Social networking is huge (Twitter, Facebook, …)
  Many mobile applications use Rails as a backend
Rails is Ruby, right?
Rails is Ruby, right?
 Wrong!
Rails is Ruby, right?
 Wrong!
 Ruby is a programming
 language

                           The Ruby
                         Programming
                          Language
Rails is Ruby, right?
 Wrong!
 Ruby is a programming     The Ruby on Rails
 language                     Application
 Ruby on Rails, or Rails
                              Framework
 for short, is a               The Ruby
 framework written in        Programming
 Ruby                          Language
Rails is Ruby, right?
 Wrong!
 Ruby is a programming     The Ruby on Rails
 language                     Application
 Ruby on Rails, or Rails
                              Framework
 for short, is a               The Ruby
 framework written in        Programming
 Ruby                          Language
 You will use both
The Ruby
Programming Language
The Ruby
Programming Language
Created in Japan in 1995 by Yukihiro Matsumoto (“we
call him “matz”)
The Ruby
Programming Language
Created in Japan in 1995 by Yukihiro Matsumoto (“we
call him “matz”)
  It’s a few months older than Java, not new
The Ruby
Programming Language
Created in Japan in 1995 by Yukihiro Matsumoto (“we
call him “matz”)
  It’s a few months older than Java, not new
Is high level with many modern features: Objects,
Exception handling, Garbage collection, …
The Ruby
Programming Language
Created in Japan in 1995 by Yukihiro Matsumoto (“we
call him “matz”)
  It’s a few months older than Java, not new
Is high level with many modern features: Objects,
Exception handling, Garbage collection, …
It’s very dynamic and expressive, literally allowing you
to mold it to your specific needs
The Ruby on Rails
Application Framework
The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
Rails was extracted from the real world application
Basecamp
The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
Rails was extracted from the real world application
Basecamp
It adds Web needs to Ruby: requests and responses,
routing, database modeling, …
The Ruby on Rails
Application Framework
Created in 2003 by David Heinemeier Hansson (we call
him “DHH”)
Rails was extracted from the real world application
Basecamp
It adds Web needs to Ruby: requests and responses,
routing, database modeling, …
It also modifies Ruby’s core in quite a few places to
better suit the problem domain of Web applications
Railsisms
Rails is very opinionated software!
The Rails Way
The Rails Way

Rails often has a preferred approach to a task and it
assumes you will be taking that approach
The Rails Way

Rails often has a preferred approach to a task and it
assumes you will be taking that approach
You can almost always choose to do things the non-
Rails way
The Rails Way

Rails often has a preferred approach to a task and it
assumes you will be taking that approach
You can almost always choose to do things the non-
Rails way
  However, this will not be as easy
The Rails Way

Rails often has a preferred approach to a task and it
assumes you will be taking that approach
You can almost always choose to do things the non-
Rails way
  However, this will not be as easy
The path of least pain is definitely to do things the Rails
way whenever possible
Convention Over
Configuration
Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Instead of always asking, Rails will assume you are
following conventions (no configuration needed)
Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Instead of always asking, Rails will assume you are
following conventions (no configuration needed)
  This makes following the conventions easy
Convention Over
Configuration
Rails has considerably less configuration files than
many other Web frameworks
Instead of always asking, Rails will assume you are
following conventions (no configuration needed)
  This makes following the conventions easy
  If you need to break conventions, things will be less
  easy
MVC Architecture
MVC Architecture

Rails separates code:
MVC Architecture

Rails separates code:            Database
  Models (database–     Models
  business logic)
MVC Architecture

Rails separates code:             Database
  Models (database–     Models
  business logic)
  Views (Web pages,
  RSS feeds, …)
                                    View
                        Browser
MVC Architecture

Rails separates code:             Database
  Models (database–     Models
  business logic)
  Views (Web pages,         Controller
  RSS feeds, …)
                                    View
  Controllers (manage
  communication)
                        Browser
Rails Cares How You Code
Rails Cares How You Code
DRY
Rails Cares How You Code
DRY
 Don’t Repeat Yourself
Rails Cares How You Code
DRY
 Don’t Repeat Yourself
 Rails has tools to help you avoid repeating code
Rails Cares How You Code
DRY
 Don’t Repeat Yourself
 Rails has tools to help you avoid repeating code
YAGNI
Rails Cares How You Code
DRY
 Don’t Repeat Yourself
 Rails has tools to help you avoid repeating code
YAGNI
 You Ain’t Gonna Need It
Rails Cares How You Code
DRY
 Don’t Repeat Yourself
 Rails has tools to help you avoid repeating code
YAGNI
 You Ain’t Gonna Need It
 Rails is agile and can help you change as needed
Rails Cares How You Code
DRY
  Don’t Repeat Yourself
  Rails has tools to help you avoid repeating code
YAGNI
  You Ain’t Gonna Need It
  Rails is agile and can help you change as needed
Rails encourages TDD (Test Driven Development)
The Anatomy
of a Rails Project
Let’s take a first look at how Rails prefers to
keep its house
Starting a Rails Project
Starting a Rails Project
                             $ rails -d sqlite3 my_project
 Ask Rails to create             create
                                 create app/controllers
 things for you, so it can       create app/helpers
                                 create app/models

 do it the way it prefers        create app/views/layouts
                                 create config/environments
                                 create config/initializers
                                 create config/locales
                                 create db
                                 create doc
                                 create lib
                                 create lib/tasks
                                 create log
                                 create public/images
                                 create public/javascripts
                                 create public/stylesheets
                                 create script/performance
                                 create test/fixtures
                                 create test/functional
                                 create test/integration
                                 …
Starting a Rails Project
                             $ rails -d sqlite3 my_project
 Ask Rails to create             create
                                 create app/controllers
 things for you, so it can       create app/helpers
                                 create app/models

 do it the way it prefers        create app/views/layouts
                                 create config/environments
                                 create config/initializers
                                 create config/locales
 To start a project, just        create db
                                 create doc
 name it                         create lib
                                 create lib/tasks
                                 create log
                                 create public/images
                                 create public/javascripts
                                 create public/stylesheets
                                 create script/performance
                                 create test/fixtures
                                 create test/functional
                                 create test/integration
                                 …
Starting a Rails Project
                             $ rails -d sqlite3 my_project
 Ask Rails to create             create
                                 create app/controllers
 things for you, so it can       create app/helpers
                                 create app/models

 do it the way it prefers        create app/views/layouts
                                 create config/environments
                                 create config/initializers
                                 create config/locales
 To start a project, just        create db
                                 create doc
 name it                         create lib
                                 create lib/tasks
                                 create log

 Optionally, you can             create public/images
                                 create public/javascripts
                                 create public/stylesheets
 choose a database               create script/performance
                                 create test/fixtures
                                 create test/functional
                                 create test/integration
                                 …
Starting a Rails Project
                             $ rails -d sqlite3 my_project
 Ask Rails to create             create
                                 create app/controllers
 things for you, so it can       create app/helpers
                                 create app/models

 do it the way it prefers        create app/views/layouts
                                 create config/environments
                                 create config/initializers
                                 create config/locales
 To start a project, just        create db
                                 create doc
 name it                         create lib
                                 create lib/tasks
                                 create log

 Optionally, you can             create public/images
                                 create public/javascripts
                                 create public/stylesheets
 choose a database               create script/performance
                                 create test/fixtures
                                 create test/functional
   SQLite is simple              create test/integration
                                 …
The app/ Directory
The app/ Directory

The heart of your
application
The app/ Directory

The heart of your
application
You can see the MVC
design in here
The app/ Directory

The heart of your
application
You can see the MVC
design in here
  Helpers relate to
  views
The lib/ and
vendor/ Directories
The lib/ and
vendor/ Directories
 lib/ is for library code
 shared by your entire
 application
The lib/ and
vendor/ Directories
 lib/ is for library code
 shared by your entire
 application
   It also holds
   maintenance tasks
The lib/ and
vendor/ Directories
 lib/ is for library code
 shared by your entire
 application
   It also holds
   maintenance tasks
 vendor/ is for third
 party extensions
 (“gems”) or plugins
The test/ Directory
The test/ Directory

 Rails encourages you
 to test your application
 on multiple levels
The test/ Directory

 Rails encourages you
 to test your application
 on multiple levels
 It also provides tools
 for loading test data
 and doing performance
 testing
The public/ Directory
The public/ Directory
 For static assets:
The public/ Directory
 For static assets:
   Static HTML pages
The public/ Directory
 For static assets:
   Static HTML pages
   Error Pages
The public/ Directory
 For static assets:
   Static HTML pages
   Error Pages
   Images and CSS
The public/ Directory
 For static assets:
   Static HTML pages
   Error Pages
   Images and CSS
   JavaScript
   (Prototype and
   script.aculo.us
   included)
The config/ Directory
The config/ Directory

Where you can change
Rails configuration
The config/ Directory

Where you can change
Rails configuration
  It’s all set to
  conventions for you
The config/ Directory

Where you can change
Rails configuration
  It’s all set to
  conventions for you
Note that Rails can run
in three different modes
config/database.yml
Rails configures a different database
for each environment
# SQLite version 3.x
     # gem install sqlite3-ruby (not necessary on OS X Leopard)
     development:
      adapter: sqlite3
      database: db/development.sqlite3
      pool: 5
      timeout: 5000

     # Warning: The database defined as "test" will be erased and
     # re-generated from your development database when you run "rake".
     # Do not set this db to the same as development or production.
     test:
      adapter: sqlite3
      database: db/test.sqlite3
      pool: 5
      timeout: 5000

     production:
      adapter: sqlite3
      database: db/production.sqlite3
      pool: 5
      timeout: 5000




config/database.yml
Rails configures a different database
for each environment
# SQLite version 3.x
     # gem install sqlite3-ruby (not necessary on OS X Leopard)
     development:
      adapter: sqlite3
      database: db/development.sqlite3
      pool: 5
      timeout: 5000

     # Warning: The database defined as "test" will be erased and
     # re-generated from your development database when you run "rake".
     # Do not set this db to the same as development or production.
     test:
      adapter: sqlite3
      database: db/test.sqlite3
      pool: 5
      timeout: 5000

     production:
      adapter: sqlite3
      database: db/production.sqlite3
      pool: 5
      timeout: 5000




config/database.yml
Rails configures a different database
for each environment
The log/ Directory
The log/ Directory

 Rails logs events from
 each of its
 environments
The log/ Directory

 Rails logs events from
 each of its
 environments
 This helps debug
 issues
The log/ Directory

 Rails logs events from
 each of its
 environments
 This helps debug
 issues
 It can also be used for
 statistics tracking
The Rakefile and
script/ Directory
The Rakefile and
script/ Directory
 Rails has scripts for:
The Rakefile and
script/ Directory
 Rails has scripts for:
   Creating new models
   and controllers
The Rakefile and
script/ Directory
 Rails has scripts for:
   Creating new models
   and controllers
   Interactively working
   with your models
The Rakefile and
script/ Directory
 Rails has scripts for:
   Creating new models
   and controllers
   Interactively working
   with your models
   Installing plugins
The Rakefile and
script/ Directory
 Rails has scripts for:
   Creating new models
   and controllers
   Interactively working
   with your models
   Installing plugins
   Running your code
The Rakefile and
script/ Directory
 Rails has scripts for:
   Creating new models
   and controllers
   Interactively working
   with your models
   Installing plugins
   Running your code
   Maintenance tasks
script/server
Launching your Rails application is as simple as
triggering the server script
$ cd my_project
   $ script/server
   => Booting Mongrel
   => Rails 2.3.5 application starting on http://0.0.0.0:3000
   => Call with -d to detach
   => Ctrl-C to shutdown server




script/server
Launching your Rails application is as simple as
triggering the server script
$ cd my_project
   $ script/server
   => Booting Mongrel
   => Rails 2.3.5 application starting on http://0.0.0.0:3000
   => Call with -d to detach
   => Ctrl-C to shutdown server




script/server
Launching your Rails application is as simple as
triggering the server script
Rails Up and Running
Browse to http://localhost:3000/
to see your application running
Questions?
Creating a
Rails Application Lab
Your book has instructions for getting started
with a Rails application: team up and try it!

More Related Content

What's hot

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsousli07
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsManoj Kumar
 
Better Framework Better Life
Better Framework Better LifeBetter Framework Better Life
Better Framework Better Lifejeffz
 
2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rbawwaiid
 
Coffee scripts with rails
Coffee scripts with railsCoffee scripts with rails
Coffee scripts with railsDevilal Dheer
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better lifeDaniel Lv
 
Java script for foxpro developers
Java script for foxpro developersJava script for foxpro developers
Java script for foxpro developersMike Feltman
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptAxway Appcelerator
 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browserForrest Chang
 
Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1James Thompson
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Core Data in RubyMotion #inspect
Core Data in RubyMotion #inspectCore Data in RubyMotion #inspect
Core Data in RubyMotion #inspectLori Olson
 
PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015kyphpug
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formattersVisuality
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptWojciech Dzikowski
 

What's hot (20)

RubyonRails
RubyonRailsRubyonRails
RubyonRails
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Better Framework Better Life
Better Framework Better LifeBetter Framework Better Life
Better Framework Better Life
 
2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb2016-05-12 DCRUG React.rb
2016-05-12 DCRUG React.rb
 
Hanami
HanamiHanami
Hanami
 
Ruby Beyond Rails
Ruby Beyond RailsRuby Beyond Rails
Ruby Beyond Rails
 
Coffee scripts with rails
Coffee scripts with railsCoffee scripts with rails
Coffee scripts with rails
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better life
 
Java script for foxpro developers
Java script for foxpro developersJava script for foxpro developers
Java script for foxpro developers
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browser
 
Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Core Data in RubyMotion #inspect
Core Data in RubyMotion #inspectCore Data in RubyMotion #inspect
Core Data in RubyMotion #inspect
 
PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015PHP Frameworks Review - Mar 19 2015
PHP Frameworks Review - Mar 19 2015
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
 
Intro for RoR
Intro for RoRIntro for RoR
Intro for RoR
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 

Viewers also liked

Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projectsVincent Massol
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
Simple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on RailsSimple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on Railsjhenry
 
Rapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsRapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsSimobo
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with RailsYi-Ting Cheng
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.netSanket Jagare
 
Web Design Project Report
Web Design Project ReportWeb Design Project Report
Web Design Project ReportMJ Ferdous
 
47533870 final-project-report
47533870 final-project-report47533870 final-project-report
47533870 final-project-reportMohammed Meraj
 

Viewers also liked (11)

Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projects
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Simple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on RailsSimple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on Rails
 
Rapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsRapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on Rails
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.net
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Web Design Project Report
Web Design Project ReportWeb Design Project Report
Web Design Project Report
 
47533870 final-project-report
47533870 final-project-report47533870 final-project-report
47533870 final-project-report
 
Atm System
Atm SystemAtm System
Atm System
 
SlideShare 101
SlideShare 101SlideShare 101
SlideShare 101
 

Similar to Wed Development on Rails

Finding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdfFinding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdfaspleenic
 
Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Chris Houng
 
Is ruby on rails dead or still good choice for building apps
Is ruby on rails dead or still good choice for building appsIs ruby on rails dead or still good choice for building apps
Is ruby on rails dead or still good choice for building appsTemok IT Services
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
Feels Like Ruby - Ruby Kaigi 2010
Feels Like Ruby - Ruby Kaigi 2010Feels Like Ruby - Ruby Kaigi 2010
Feels Like Ruby - Ruby Kaigi 2010Sarah Mei
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHPGautam Rege
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Brian Sam-Bodden
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails PresentationPaul Pajo
 
What rails taught me – Eugene Pirogov
What rails taught me – Eugene PirogovWhat rails taught me – Eugene Pirogov
What rails taught me – Eugene PirogovRuby Meditation
 
Ruby Rails Web Development.pdf
Ruby Rails Web Development.pdfRuby Rails Web Development.pdf
Ruby Rails Web Development.pdfAyesha Siddika
 
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
 
Make your app idea a reality with Ruby On Rails
Make your app idea a reality with Ruby On RailsMake your app idea a reality with Ruby On Rails
Make your app idea a reality with Ruby On RailsNataly Tkachuk
 
Javascript beginner-handbook
Javascript beginner-handbookJavascript beginner-handbook
Javascript beginner-handbookFaina Fridman
 
javascript-beginner-handbook.pdf
javascript-beginner-handbook.pdfjavascript-beginner-handbook.pdf
javascript-beginner-handbook.pdfRaviKumar76265
 
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
 
Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story Engine Yard
 
Introduction to Ruby & Modern Programming
Introduction to Ruby & Modern ProgrammingIntroduction to Ruby & Modern Programming
Introduction to Ruby & Modern ProgrammingChristos Sotirelis
 
Ruby Nuby Session - Rails Intro
Ruby Nuby Session - Rails IntroRuby Nuby Session - Rails Intro
Ruby Nuby Session - Rails IntroJohn Barton
 

Similar to Wed Development on Rails (20)

Finding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdfFinding Frank - Spotify API.pdf
Finding Frank - Spotify API.pdf
 
Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來
 
Is ruby on rails dead or still good choice for building apps
Is ruby on rails dead or still good choice for building appsIs ruby on rails dead or still good choice for building apps
Is ruby on rails dead or still good choice for building apps
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
Feels Like Ruby - Ruby Kaigi 2010
Feels Like Ruby - Ruby Kaigi 2010Feels Like Ruby - Ruby Kaigi 2010
Feels Like Ruby - Ruby Kaigi 2010
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails Presentation
 
What rails taught me – Eugene Pirogov
What rails taught me – Eugene PirogovWhat rails taught me – Eugene Pirogov
What rails taught me – Eugene Pirogov
 
Ruby Rails Web Development.pdf
Ruby Rails Web Development.pdfRuby Rails Web Development.pdf
Ruby Rails Web Development.pdf
 
Ruby Metaprogramming 08
Ruby Metaprogramming 08Ruby Metaprogramming 08
Ruby Metaprogramming 08
 
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
 
Make your app idea a reality with Ruby On Rails
Make your app idea a reality with Ruby On RailsMake your app idea a reality with Ruby On Rails
Make your app idea a reality with Ruby On Rails
 
Javascript beginner-handbook
Javascript beginner-handbookJavascript beginner-handbook
Javascript beginner-handbook
 
javascript-beginner-handbook.pdf
javascript-beginner-handbook.pdfjavascript-beginner-handbook.pdf
javascript-beginner-handbook.pdf
 
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
 
Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story
 
Intro to Rails
Intro to RailsIntro to Rails
Intro to Rails
 
Introduction to Ruby & Modern Programming
Introduction to Ruby & Modern ProgrammingIntroduction to Ruby & Modern Programming
Introduction to Ruby & Modern Programming
 
Ruby Nuby Session - Rails Intro
Ruby Nuby Session - Rails IntroRuby Nuby Session - Rails Intro
Ruby Nuby Session - Rails Intro
 

More from James Gray

A Dickens of A Keynote
A Dickens of A KeynoteA Dickens of A Keynote
A Dickens of A KeynoteJames Gray
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsJames Gray
 
Counting on God
Counting on GodCounting on God
Counting on GodJames Gray
 
In the Back of Your Mind
In the Back of Your MindIn the Back of Your Mind
In the Back of Your MindJames Gray
 
Amazon's Simple Storage Service (S3)
Amazon's Simple Storage Service (S3)Amazon's Simple Storage Service (S3)
Amazon's Simple Storage Service (S3)James Gray
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubJames Gray
 
Test Coverage in Rails
Test Coverage in RailsTest Coverage in Rails
Test Coverage in RailsJames Gray
 
Rails Routing And Rendering
Rails Routing And RenderingRails Routing And Rendering
Rails Routing And RenderingJames Gray
 
Sending Email with Rails
Sending Email with RailsSending Email with Rails
Sending Email with RailsJames Gray
 
Associations in Rails
Associations in RailsAssociations in Rails
Associations in RailsJames Gray
 
DRYing Up Rails Views and Controllers
DRYing Up Rails Views and ControllersDRYing Up Rails Views and Controllers
DRYing Up Rails Views and ControllersJames Gray
 
Building a Rails Interface
Building a Rails InterfaceBuilding a Rails Interface
Building a Rails InterfaceJames Gray
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model BasicsJames Gray
 

More from James Gray (18)

A Dickens of A Keynote
A Dickens of A KeynoteA Dickens of A Keynote
A Dickens of A Keynote
 
I Doubt That!
I Doubt That!I Doubt That!
I Doubt That!
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Counting on God
Counting on GodCounting on God
Counting on God
 
In the Back of Your Mind
In the Back of Your MindIn the Back of Your Mind
In the Back of Your Mind
 
Unblocked
UnblockedUnblocked
Unblocked
 
Module Magic
Module MagicModule Magic
Module Magic
 
API Design
API DesignAPI Design
API Design
 
Amazon's Simple Storage Service (S3)
Amazon's Simple Storage Service (S3)Amazon's Simple Storage Service (S3)
Amazon's Simple Storage Service (S3)
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Test Coverage in Rails
Test Coverage in RailsTest Coverage in Rails
Test Coverage in Rails
 
Rails Routing And Rendering
Rails Routing And RenderingRails Routing And Rendering
Rails Routing And Rendering
 
Sending Email with Rails
Sending Email with RailsSending Email with Rails
Sending Email with Rails
 
Associations in Rails
Associations in RailsAssociations in Rails
Associations in Rails
 
DRYing Up Rails Views and Controllers
DRYing Up Rails Views and ControllersDRYing Up Rails Views and Controllers
DRYing Up Rails Views and Controllers
 
Building a Rails Interface
Building a Rails InterfaceBuilding a Rails Interface
Building a Rails Interface
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model Basics
 
Ruby
RubyRuby
Ruby
 

Recently uploaded

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 

Recently uploaded (20)

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 

Wed Development on Rails

  • 1. Web Development on Rails Introducing James and Dana Gray, this training, and Ruby on Rails
  • 2. Teachers and Students We’re going to spend three days working together, so let’s get to know each other
  • 4. Who am I? My name: James Edward Gray II
  • 5. Who am I? My name: James Edward Gray II My experience: I’ve been using Ruby since before Rails was released and in the last five years I’ve worked on over 30 shipping Rails applications
  • 6. Who am I? My name: James Edward Gray II My experience: I’ve been using Ruby since before Rails was released and in the last five years I’ve worked on over 30 shipping Rails applications The One True Dessert Food: Angel food cake
  • 7. Who is my partner?
  • 8. Who is my partner? Her name: Dana Gray
  • 9. Who is my partner? Her name: Dana Gray What James thinks about her: She’s cute!
  • 10. Who is my partner? Her name: Dana Gray What James thinks about her: She’s cute! Her secret: She’s having a baby
  • 11. Who is my partner? Her name: Dana Gray What James thinks about her: She’s cute! Her secret: She’s having a baby Ignore what she says about dessert because we already learned it is: Angel food cake
  • 13. Your turn! Please tell us:
  • 14. Your turn! Please tell us: Your name
  • 15. Your turn! Please tell us: Your name What you know of Ruby/Rails and what you hope to learn in this training
  • 16. Your turn! Please tell us: Your name What you know of Ruby/Rails and what you hope to learn in this training A fun fact (doesn’t have to be your favorite dessert)
  • 17. This Training What the heck are we doing here?
  • 18. We Will Teach Web Development
  • 19. We Will Teach Web Development We are going to teach you how to build complete Web applications using Rails
  • 20. We Will Teach Web Development We are going to teach you how to build complete Web applications using Rails It’s a lot to cover and we don’t have time to do it all
  • 21. We Will Teach Web Development We are going to teach you how to build complete Web applications using Rails It’s a lot to cover and we don’t have time to do it all We will hit the basics
  • 22. We Will Teach Web Development We are going to teach you how to build complete Web applications using Rails It’s a lot to cover and we don’t have time to do it all We will hit the basics We will dig deeper in some areas
  • 23. We Will Teach Web Development We are going to teach you how to build complete Web applications using Rails It’s a lot to cover and we don’t have time to do it all We will hit the basics We will dig deeper in some areas We’re assuming you have minimal HTML, CSS, JavaScript, and programming knowledge
  • 25. We Have Hands-on Labs Theory is great, and we will teach that about half of the time, but you learn Rails by building Rails applications
  • 26. We Have Hands-on Labs Theory is great, and we will teach that about half of the time, but you learn Rails by building Rails applications This training is roughly half lab exercises
  • 27. We Have Hands-on Labs Theory is great, and we will teach that about half of the time, but you learn Rails by building Rails applications This training is roughly half lab exercises You will build a working Rails application over the next three days
  • 28. We Have Hands-on Labs Theory is great, and we will teach that about half of the time, but you learn Rails by building Rails applications This training is roughly half lab exercises You will build a working Rails application over the next three days Make some new friends and work together!
  • 29. We Have Hands-on Labs Theory is great, and we will teach that about half of the time, but you learn Rails by building Rails applications This training is roughly half lab exercises You will build a working Rails application over the next three days Make some new friends and work together! I promise you will both learn more that way!
  • 31. We are Interactive Wake up!
  • 32. We are Interactive Wake up! We like questions
  • 33. We are Interactive Wake up! We like questions Everyone benefits if we turn this into more of a discussion and less of a lecture
  • 34. We are Interactive Wake up! We like questions Everyone benefits if we turn this into more of a discussion and less of a lecture Help us
  • 35. We are Interactive Wake up! We like questions Everyone benefits if we turn this into more of a discussion and less of a lecture Help us Please stop us with questions as you have them
  • 36. Ruby on Rails What exactly is this “Rails” thing?
  • 38. Software Moved Online Ruby on Rails is a framework for building web applications (interactive Web sites)
  • 39. Software Moved Online Ruby on Rails is a framework for building web applications (interactive Web sites) Web development has exploded
  • 40. Software Moved Online Ruby on Rails is a framework for building web applications (interactive Web sites) Web development has exploded Think about how many boxed software applications you buy now verses how many Web sites you use
  • 41. Software Moved Online Ruby on Rails is a framework for building web applications (interactive Web sites) Web development has exploded Think about how many boxed software applications you buy now verses how many Web sites you use Social networking is huge (Twitter, Facebook, …)
  • 42. Software Moved Online Ruby on Rails is a framework for building web applications (interactive Web sites) Web development has exploded Think about how many boxed software applications you buy now verses how many Web sites you use Social networking is huge (Twitter, Facebook, …) Many mobile applications use Rails as a backend
  • 43. Rails is Ruby, right?
  • 44. Rails is Ruby, right? Wrong!
  • 45. Rails is Ruby, right? Wrong! Ruby is a programming language The Ruby Programming Language
  • 46. Rails is Ruby, right? Wrong! Ruby is a programming The Ruby on Rails language Application Ruby on Rails, or Rails Framework for short, is a The Ruby framework written in Programming Ruby Language
  • 47. Rails is Ruby, right? Wrong! Ruby is a programming The Ruby on Rails language Application Ruby on Rails, or Rails Framework for short, is a The Ruby framework written in Programming Ruby Language You will use both
  • 49. The Ruby Programming Language Created in Japan in 1995 by Yukihiro Matsumoto (“we call him “matz”)
  • 50. The Ruby Programming Language Created in Japan in 1995 by Yukihiro Matsumoto (“we call him “matz”) It’s a few months older than Java, not new
  • 51. The Ruby Programming Language Created in Japan in 1995 by Yukihiro Matsumoto (“we call him “matz”) It’s a few months older than Java, not new Is high level with many modern features: Objects, Exception handling, Garbage collection, …
  • 52. The Ruby Programming Language Created in Japan in 1995 by Yukihiro Matsumoto (“we call him “matz”) It’s a few months older than Java, not new Is high level with many modern features: Objects, Exception handling, Garbage collection, … It’s very dynamic and expressive, literally allowing you to mold it to your specific needs
  • 53. The Ruby on Rails Application Framework
  • 54. The Ruby on Rails Application Framework Created in 2003 by David Heinemeier Hansson (we call him “DHH”)
  • 55. The Ruby on Rails Application Framework Created in 2003 by David Heinemeier Hansson (we call him “DHH”) Rails was extracted from the real world application Basecamp
  • 56. The Ruby on Rails Application Framework Created in 2003 by David Heinemeier Hansson (we call him “DHH”) Rails was extracted from the real world application Basecamp It adds Web needs to Ruby: requests and responses, routing, database modeling, …
  • 57. The Ruby on Rails Application Framework Created in 2003 by David Heinemeier Hansson (we call him “DHH”) Rails was extracted from the real world application Basecamp It adds Web needs to Ruby: requests and responses, routing, database modeling, … It also modifies Ruby’s core in quite a few places to better suit the problem domain of Web applications
  • 58. Railsisms Rails is very opinionated software!
  • 60. The Rails Way Rails often has a preferred approach to a task and it assumes you will be taking that approach
  • 61. The Rails Way Rails often has a preferred approach to a task and it assumes you will be taking that approach You can almost always choose to do things the non- Rails way
  • 62. The Rails Way Rails often has a preferred approach to a task and it assumes you will be taking that approach You can almost always choose to do things the non- Rails way However, this will not be as easy
  • 63. The Rails Way Rails often has a preferred approach to a task and it assumes you will be taking that approach You can almost always choose to do things the non- Rails way However, this will not be as easy The path of least pain is definitely to do things the Rails way whenever possible
  • 65. Convention Over Configuration Rails has considerably less configuration files than many other Web frameworks
  • 66. Convention Over Configuration Rails has considerably less configuration files than many other Web frameworks Instead of always asking, Rails will assume you are following conventions (no configuration needed)
  • 67. Convention Over Configuration Rails has considerably less configuration files than many other Web frameworks Instead of always asking, Rails will assume you are following conventions (no configuration needed) This makes following the conventions easy
  • 68. Convention Over Configuration Rails has considerably less configuration files than many other Web frameworks Instead of always asking, Rails will assume you are following conventions (no configuration needed) This makes following the conventions easy If you need to break conventions, things will be less easy
  • 71. MVC Architecture Rails separates code: Database Models (database– Models business logic)
  • 72. MVC Architecture Rails separates code: Database Models (database– Models business logic) Views (Web pages, RSS feeds, …) View Browser
  • 73. MVC Architecture Rails separates code: Database Models (database– Models business logic) Views (Web pages, Controller RSS feeds, …) View Controllers (manage communication) Browser
  • 74. Rails Cares How You Code
  • 75. Rails Cares How You Code DRY
  • 76. Rails Cares How You Code DRY Don’t Repeat Yourself
  • 77. Rails Cares How You Code DRY Don’t Repeat Yourself Rails has tools to help you avoid repeating code
  • 78. Rails Cares How You Code DRY Don’t Repeat Yourself Rails has tools to help you avoid repeating code YAGNI
  • 79. Rails Cares How You Code DRY Don’t Repeat Yourself Rails has tools to help you avoid repeating code YAGNI You Ain’t Gonna Need It
  • 80. Rails Cares How You Code DRY Don’t Repeat Yourself Rails has tools to help you avoid repeating code YAGNI You Ain’t Gonna Need It Rails is agile and can help you change as needed
  • 81. Rails Cares How You Code DRY Don’t Repeat Yourself Rails has tools to help you avoid repeating code YAGNI You Ain’t Gonna Need It Rails is agile and can help you change as needed Rails encourages TDD (Test Driven Development)
  • 82. The Anatomy of a Rails Project Let’s take a first look at how Rails prefers to keep its house
  • 83. Starting a Rails Project
  • 84. Starting a Rails Project $ rails -d sqlite3 my_project Ask Rails to create create create app/controllers things for you, so it can create app/helpers create app/models do it the way it prefers create app/views/layouts create config/environments create config/initializers create config/locales create db create doc create lib create lib/tasks create log create public/images create public/javascripts create public/stylesheets create script/performance create test/fixtures create test/functional create test/integration …
  • 85. Starting a Rails Project $ rails -d sqlite3 my_project Ask Rails to create create create app/controllers things for you, so it can create app/helpers create app/models do it the way it prefers create app/views/layouts create config/environments create config/initializers create config/locales To start a project, just create db create doc name it create lib create lib/tasks create log create public/images create public/javascripts create public/stylesheets create script/performance create test/fixtures create test/functional create test/integration …
  • 86. Starting a Rails Project $ rails -d sqlite3 my_project Ask Rails to create create create app/controllers things for you, so it can create app/helpers create app/models do it the way it prefers create app/views/layouts create config/environments create config/initializers create config/locales To start a project, just create db create doc name it create lib create lib/tasks create log Optionally, you can create public/images create public/javascripts create public/stylesheets choose a database create script/performance create test/fixtures create test/functional create test/integration …
  • 87. Starting a Rails Project $ rails -d sqlite3 my_project Ask Rails to create create create app/controllers things for you, so it can create app/helpers create app/models do it the way it prefers create app/views/layouts create config/environments create config/initializers create config/locales To start a project, just create db create doc name it create lib create lib/tasks create log Optionally, you can create public/images create public/javascripts create public/stylesheets choose a database create script/performance create test/fixtures create test/functional SQLite is simple create test/integration …
  • 89. The app/ Directory The heart of your application
  • 90. The app/ Directory The heart of your application You can see the MVC design in here
  • 91. The app/ Directory The heart of your application You can see the MVC design in here Helpers relate to views
  • 92. The lib/ and vendor/ Directories
  • 93. The lib/ and vendor/ Directories lib/ is for library code shared by your entire application
  • 94. The lib/ and vendor/ Directories lib/ is for library code shared by your entire application It also holds maintenance tasks
  • 95. The lib/ and vendor/ Directories lib/ is for library code shared by your entire application It also holds maintenance tasks vendor/ is for third party extensions (“gems”) or plugins
  • 97. The test/ Directory Rails encourages you to test your application on multiple levels
  • 98. The test/ Directory Rails encourages you to test your application on multiple levels It also provides tools for loading test data and doing performance testing
  • 100. The public/ Directory For static assets:
  • 101. The public/ Directory For static assets: Static HTML pages
  • 102. The public/ Directory For static assets: Static HTML pages Error Pages
  • 103. The public/ Directory For static assets: Static HTML pages Error Pages Images and CSS
  • 104. The public/ Directory For static assets: Static HTML pages Error Pages Images and CSS JavaScript (Prototype and script.aculo.us included)
  • 106. The config/ Directory Where you can change Rails configuration
  • 107. The config/ Directory Where you can change Rails configuration It’s all set to conventions for you
  • 108. The config/ Directory Where you can change Rails configuration It’s all set to conventions for you Note that Rails can run in three different modes
  • 109. config/database.yml Rails configures a different database for each environment
  • 110. # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000 config/database.yml Rails configures a different database for each environment
  • 111. # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000 config/database.yml Rails configures a different database for each environment
  • 113. The log/ Directory Rails logs events from each of its environments
  • 114. The log/ Directory Rails logs events from each of its environments This helps debug issues
  • 115. The log/ Directory Rails logs events from each of its environments This helps debug issues It can also be used for statistics tracking
  • 117. The Rakefile and script/ Directory Rails has scripts for:
  • 118. The Rakefile and script/ Directory Rails has scripts for: Creating new models and controllers
  • 119. The Rakefile and script/ Directory Rails has scripts for: Creating new models and controllers Interactively working with your models
  • 120. The Rakefile and script/ Directory Rails has scripts for: Creating new models and controllers Interactively working with your models Installing plugins
  • 121. The Rakefile and script/ Directory Rails has scripts for: Creating new models and controllers Interactively working with your models Installing plugins Running your code
  • 122. The Rakefile and script/ Directory Rails has scripts for: Creating new models and controllers Interactively working with your models Installing plugins Running your code Maintenance tasks
  • 123. script/server Launching your Rails application is as simple as triggering the server script
  • 124. $ cd my_project $ script/server => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server script/server Launching your Rails application is as simple as triggering the server script
  • 125. $ cd my_project $ script/server => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server script/server Launching your Rails application is as simple as triggering the server script
  • 126. Rails Up and Running Browse to http://localhost:3000/ to see your application running
  • 128. Creating a Rails Application Lab Your book has instructions for getting started with a Rails application: team up and try it!

Editor's Notes