SlideShare uma empresa Scribd logo
1 de 128
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!

Mais conteúdo relacionado

Mais procurados

Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
Manoj Kumar
 
Java script for foxpro developers
Java script for foxpro developersJava script for foxpro developers
Java script for foxpro developers
Mike Feltman
 

Mais procurados (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
 

Destaque

Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi 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 Rails
jhenry
 
47533870 final-project-report
47533870 final-project-report47533870 final-project-report
47533870 final-project-report
Mohammed Meraj
 

Destaque (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
 

Semelhante a Wed Development on Rails

Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
knoppix
 
Ruby Rails Web Development.pdf
Ruby Rails Web Development.pdfRuby Rails Web Development.pdf
Ruby Rails Web Development.pdf
Ayesha Siddika
 
Javascript beginner-handbook
Javascript beginner-handbookJavascript beginner-handbook
Javascript beginner-handbook
Faina Fridman
 
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
arif44
 
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
 

Semelhante a 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
 

Mais de James Gray

A Dickens of A Keynote
A Dickens of A KeynoteA Dickens of A Keynote
A Dickens of A Keynote
James Gray
 

Mais de 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
 

Ú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@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+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...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

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!

Notas do Editor