SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Downloaden Sie, um offline zu lesen
Ruby on Rails For Java
   Programmers
          Rob Sanheim

      www.robsanheim.com
      www.seekingalpha.com
        www.ajaxian.com
(Briefly) About Me
Why Rails?
Because its fun.
Because it will
make you a better
  programmer.
“Learn at least one new [programming] language
 every year. Different languages solve the same
 problems in different ways. By learning several
different approaches, you can help broaden your
     thinking and avoid getting stuck in a rut.”
                - David Thomas and Andy Hunt
Because you might
just be able to get
    paid for it.
What is Ruby?
• Fully Object Oriented
• Interpreted
• Simple,Yet Powerful
• Open Source
• Born in Japan in 1995
• Yukihiro Matsumoto (“Matz”)
Power
• Closures (aka Blocks)
• Modules
• Reflection
• Open Classes
Typing

• Strong
• Dynamic
• “Duck”
Lets see some code
HelloWorld
Reading a file
Reading a file - Ruby
Collections
Reflection
Ruby on Rails

• David Heinemeier Hansson (DHH)
• Began via Basecamp in mid 2003
• Released July 2004
• Full Stack MVC Web Framework
• Easy database-based web apps
Accolades


• 2006 Jolt award - Web Dev Tool
• Featured in BusinessWeek, Wired
• DHH “Best Hacker” award from Google
Converts

• Dave Thomas
• Bruce Tate
• Stuart Halloway
• Justin Gehtland
• David Geary
• James Duncan Davidson
“Rails is the most well thought-out
 web development framework I’ve ever
 used. And that’s in a decade of doing
web applications for a living. I’ve built
 my own frameworks, helped develop
the Servlet API, and have created more
 than a few web servers from scratch.
 Nobody has done it like this before.”

 -James Duncan Davidson, Creator of
          Tomcat and Ant
Platform


• MySQL, PostgreSQL, SQLite, Oracle,
 SQL Server, DB2, or Firebird
• develop anywhere
• Apache or LightTPD + FastCGI for
 production
* Done via intelligent
reflection and
metaprogramming
* Emphasis on writing code
to get stuff done - avoid
boilerplate
* Scaffolding handles left
over boilerplate




                       DRY - Don’t
                      Repeat Yourself
NO XML!
Intelligent Defaults
Only explicitly configure
when necessary




                Convention over
                 Configuration
ActiveRecord
 An object that wraps a row in a database
 table or view, encapsulates the database
access, and adds domain logic on that data.
Controller and
             View
• ActionPack maps URLs to controller
• View handled via Ruby in HTML (RHTML) or builders
• Ajax provided via Prototype and RJS
from: http://www.slash7.com/articles/2005/02/22/mvc-the-most-vexing-conundrum
Lets see some code
create table orders (
 id               int            not null    auto_increment,
 name             varchar(100)   not null,
 email            varchar(255)   not null,
 address          text           not null,
 pay_type         char(10)       not null,
 shipped_at
      datetime       null,
 primary key (id)
);
class Order < ActiveRecord::Base
end
order = Order.new
order.name = “Rob”
order.email = “rob@yahoo.com”
order.address = “123 1st St”
order.save
an_order = Order.find(24)

robs_order = Order.find(:first, :conditions => "name = 'Rob'")

rob_count = Order.count(:all, :conditions => “name = ‘Rob’”)




robs_order = Order.find_by_name(“Rob”)

more_orders = Order.find_all_by_name_and_pay_type(name, type)

Order.delete(24)

robs_order.destroy
create table order_lines (
 id              int           not null   auto_increment,
 description     varchar(100) not null,
 order_id
 
     int

      
 not null,
 primary key (id),
 constraint fk_order foreign key (order_id)
     references orders(id)
);
class Order < ActiveRecord::Base
      has_many :order_lines
 end

class OrderLine < ActiveRecord::Base

 
 
 belongs_to :order
end
                            one to many bet ween
                            orders and order lines

                            “has_many” is actually a
                            class level method call
                            that generates instance
                            methods
my_order = Order.find(id)
has_order_lines = my_order.order_lines?
order_lines_count = my_order.order_lines.size

my_order.order_lines.push(new_order, another_new_order)

specific_order_line = my_order.find(....)
specific_order_lnes = my_order.find_by_description(“abc”)

my_line = OrderLine.find(15)
has_owning_order = my_line.order.nil?

old_order = my_line.order
my_line.order= another_order
Validation
quick summary
   Gross Income                     $               0        Total Tax                     $             0
   Adjusted Gross Income            $               0        Total Payments                $             0
   Total Deductions                 $          16,400        Refund Amount                 $     * confirmation checks t wo
                                                                                                         0
   Total Taxable Income             $               0        Amount You Owe                $     password0fields against each
to file your 2005 federal extension, simply follow these instructions
                                                                                                 other
STEP A - Once your e-filed extension has been accepted, you will acceptance is pattern of
                                                                *
receive an email with a confirmation number. Enter the confirmation
number on your printed copy of Form 4868 and keep for your records. of ser vice/agreement
                                                                terms
                                                                                                 checkbox
STEP B - Since you indicated that you are not paying an amount with
Form 4868, there is nothing to mail.




For more information about tax, mortgage and financial services call   1-800-HRBLOCK   or visit hrblock.com
quick summary
   Gross Income                     $               0        Total Tax                     $                  0
   Adjusted Gross Income            $               0        Total Payments                $                  0
   Total Deductions                 $          16,400        Refund Amount                 $                  0
   Total Taxable Income             $               0        Amount You Owe                $                  0
to file your 2005 federal extension, simply follow these instructions
STEP A - Once your e-filed extension has been accepted, you will
receive an email with a confirmation number. Enter the confirmation
number on your printed copy of Form 4868 and keep for your records.
STEP B - Since you indicated that you are not paying an amount with
Form 4868, there is nothing to mail.




For more information about tax, mortgage and financial services call   1-800-HRBLOCK   or visit hrblock.com
Much More...

• many to many via has_many :through
• eager loading
• acts_as_list, acts_as_tree
• single table inheritance
• callbacks and observers
ActionController
http://url.com/weblog/
             aka
http://url.com/weblog/index.rhtml
/app/controllers/weblog_controller.rb:
class WeblogController < ActionController::Base
   layout "weblog/layout"

  def index
   @posts = Post.find_all
  end

  def display
   @post = Post.find(:params[:id])
                                                       ||= conditional assignment
  end                                                  operator

  def new                                              cart is a non persistent model
   @post = Post.new                                    object used for storing/calculating
                                                       products
  end
                                                       “the flash” = place to throw stuff
  def create                                           like response messages, error
   @post = Post.create(params[:post])                  reports that accumulate as a
                                                       request is processed
   redirect_to :action => "display", :id => @post.id
  end
 end
/app/views/weblog/layout.rhtml:
  <html><body>
  <%= @content_for_layout %>
  </body></html>

/app/views/weblog/index.rhtml:
  <% for post in @posts %>
   <p><%= link_to(post.title, :action => "display", :id => post.id %></p>
  <% end %>

/app/views/weblog/display.rhtml:
  <p>
   <b><%= post.title %></b><br/>
   <b><%= post.content %></b>
  </p>

/app/views/weblog/new.rhtml:
  <%= form "post" %>
http://url.com/weblog/display/5
http://url.com/weblog/display/123
   http://url.com/weblog/new/
ActionPack features
• rxml - XML Builders
• rhtml - HTML templates
• helpers - module to assist the view
• form and field helpers
• layouts and partials - similiar to tiles
• page caching and fragment caching
! &'())*+,%-.,//".0.1
    !"#'4,+:
    ''!3&4$'('J&4$7!5,K"#$#%&B*+,CL
    "%!
                                                 " "!$-0.2-&/
                                                    >D('?9$%E:#F'*#8:+95'(-'G&#A4G2'*+,'(-'!3&4$'D-
                                                     >D(':4H:E!4I,'''''''''''G3&4$G2'G5#%4G''D->@"-
                                                     >D(':4H:E!4I,'''''''''''G3&4$G2'G8935:$;G''D->@"-
                                                     >D('"#&&<9$,E!4I,'G3&4$G2'G"#&&<9$,G''D->@"-
                                                     7'7'7
!   NO4'#""I+8#:+95'$484+A4&'#'$4P34&:'
                                                     >D('45,E?9$%E:#F'D-
    :9'4,+:'#'3&4$7'Q:'$4#,&':O4',#:#'+5:9'
    #'54<'J&4$'%9,4I'9MR48:7                                                                   hash created with user
                                                                                               attributes for easy
"   NO4'4,+:7$O:%I':4%"I#:4'+&'8#II4,7'Q:'                                                     update/save
    3&4&':O4'+5?9$%#:+95'+5':O4'3&4$'
    9MR48:':9'F454$#:4777
                                                      #     >?9$%'#8:+95(6@%;#""@&#A4@./016-
                                                            ''''>+5"3:'5#%4(63&4$B5#%4C6'777'- field helpers   make input
#   :O4'SNTU'+&'&45:':9':O4'M$9<&4$7'
                                                            ''''>+5"3:'5#%4(63&4$B8935:$;C6'777'-
                                                                                                 (s) easy
                                                            ''''>+5"3:'5#%4(63&4$B"#&&<9$,C6'777'-
    VO45':O4'$4&"95&4'+&'$484+A4,777
                                                            ''''7'7'7
                                                            >@?9$%-
$   :O4'"#$#%4:4$&'#$4'4H:$#8:4,'+5:9'#'
    54&:4,'O#&O7'

%   NO4'&#A4'#8:+95'3&4&':O4'
    "#$#%4:4$&':9'!5,':O4'3&4$'$489$,'
    #5,'3",#:4'+:7                               $    !"#$#%&'(')
                                                      ''''*+,'(-'./012
                                                      ''''*3&4$'(-')'
                                                      ''''''''*5#%4'(-'6'777'62'
%   !"#'&#A4
                                                      ''''''''*8935:$;'(-'6'777'62
                                                      ''''''''*"#&&<9$,'(-'6'777'6''=
    ''3&4$'('J&4$7!5,K"#$#%&B*+,CL
                                                      =
    ''$#'3&4$73",#:4E#::$+M3:4&K"#$#%&B*3&4$CL
    '''''777
    ''"%!
    "%!




          Figure 17.2: Models, Controllers, and Views Work Together
Ajax Support

• Ajax support built in since March ’05
• Built on Prototype and Scriptaculous
• Updating forms and tables via Ajax is trivial
• Best Ajax support of any web framework
Other Stuff

• Awesome Testing support built in
• Generators/scaffolding
• Migrations - refactor your database
• Capistrano - automate deployment
• Huge, helpful community
But Does it Scale?
Yes.
• scales just like Yahoo! , LiveJournal, etc
• share nothing
• load balance to each tier
• add servers as needed
http://www.rubyonrails.com/applications
Why Not Rails?
• Legacy databases
• Tool support
• Deployment is hard
• Internationalization
• Its different
• Its advanced
The Future
• Rails growth will continue
• Its influence is already felt everywhere
• JRuby could be huge
• Its biggest impact may be felt in future
  frameworks
No mater what, its going to be a
          fun ride.
Thank You!

Weitere ähnliche Inhalte

Was ist angesagt?

Disregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_FormDisregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_FormDaniel Cousineau
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
 
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to askEverything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
 
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)Mark Wilkinson
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationguest5d87aa6
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)brian d foy
 
Tony Vitabile .Net Portfolio
Tony Vitabile .Net PortfolioTony Vitabile .Net Portfolio
Tony Vitabile .Net Portfoliovitabile
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyBen Hall
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginningAnis Ahmad
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress sitereferences
 
TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016CiaranMcNulty
 

Was ist angesagt? (16)

Disregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_FormDisregard Inputs, Acquire Zend_Form
Disregard Inputs, Acquire Zend_Form
 
Leveraging Symfony2 Forms
Leveraging Symfony2 FormsLeveraging Symfony2 Forms
Leveraging Symfony2 Forms
 
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
 
Zend framework 04 - forms
Zend framework 04 - formsZend framework 04 - forms
Zend framework 04 - forms
 
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to askEverything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to ask
 
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Rails <form> Chronicle
Rails <form> ChronicleRails <form> Chronicle
Rails <form> Chronicle
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
 
Tony Vitabile .Net Portfolio
Tony Vitabile .Net PortfolioTony Vitabile .Net Portfolio
Tony Vitabile .Net Portfolio
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
 
Data Validation models
Data Validation modelsData Validation models
Data Validation models
 
The new form framework
The new form frameworkThe new form framework
The new form framework
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Gail villanueva add muscle to your wordpress site
Gail villanueva   add muscle to your wordpress siteGail villanueva   add muscle to your wordpress site
Gail villanueva add muscle to your wordpress site
 
TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016TDD with PhpSpec - Lone Star PHP 2016
TDD with PhpSpec - Lone Star PHP 2016
 

Andere mochten auch

Vine - eine App die süchtig macht!
Vine - eine App die süchtig macht!Vine - eine App die süchtig macht!
Vine - eine App die süchtig macht!Nicole Hundertmark
 
iOS In-App Purchase
iOS In-App PurchaseiOS In-App Purchase
iOS In-App Purchaseacodingape
 
Protocolo de manejo da asma
Protocolo de manejo da asmaProtocolo de manejo da asma
Protocolo de manejo da asmaadrianomedico
 
Over Zelfregulering en Aansprakelijkheid
Over Zelfregulering en AansprakelijkheidOver Zelfregulering en Aansprakelijkheid
Over Zelfregulering en Aansprakelijkheidsiegfried van hoek
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome EconomyHelge Tennø
 

Andere mochten auch (6)

Vine - eine App die süchtig macht!
Vine - eine App die süchtig macht!Vine - eine App die süchtig macht!
Vine - eine App die süchtig macht!
 
iOS In-App Purchase
iOS In-App PurchaseiOS In-App Purchase
iOS In-App Purchase
 
Protocolo de manejo da asma
Protocolo de manejo da asmaProtocolo de manejo da asma
Protocolo de manejo da asma
 
Over Zelfregulering en Aansprakelijkheid
Over Zelfregulering en AansprakelijkheidOver Zelfregulering en Aansprakelijkheid
Over Zelfregulering en Aansprakelijkheid
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Ähnlich wie Rails Guide Java

Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress DeveloperJoey Kudish
 
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example   Jan Leth-KjaerPractical PHP by example   Jan Leth-Kjaer
Practical PHP by example Jan Leth-KjaerCOMMON Europe
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPiMasters
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::ManagerJay Shirley
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialYi-Ting Cheng
 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniternicdev
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatternsChul Ju Hong
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-publicChul Ju Hong
 
Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007Rabble .
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress DevelopmentAdam Tomat
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Coupa Software
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsMichelangelo van Dam
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015Fernando Hamasaki de Amorim
 

Ähnlich wie Rails Guide Java (20)

Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example   Jan Leth-KjaerPractical PHP by example   Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::Manager
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
Payments On Rails
Payments On RailsPayments On Rails
Payments On Rails
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
 
Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007Introduction to Active Record at MySQL Conference 2007
Introduction to Active Record at MySQL Conference 2007
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
 
Php
PhpPhp
Php
 
PHP-04-Forms.ppt
PHP-04-Forms.pptPHP-04-Forms.ppt
PHP-04-Forms.ppt
 
Fatc
FatcFatc
Fatc
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
 

Mehr von elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

Mehr von elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Kürzlich hochgeladen

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Rails Guide Java

  • 1. Ruby on Rails For Java Programmers Rob Sanheim www.robsanheim.com www.seekingalpha.com www.ajaxian.com
  • 5. Because it will make you a better programmer.
  • 6. “Learn at least one new [programming] language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut.” - David Thomas and Andy Hunt
  • 7. Because you might just be able to get paid for it.
  • 8. What is Ruby? • Fully Object Oriented • Interpreted • Simple,Yet Powerful • Open Source • Born in Japan in 1995 • Yukihiro Matsumoto (“Matz”)
  • 9. Power • Closures (aka Blocks) • Modules • Reflection • Open Classes
  • 13.
  • 14.
  • 16.
  • 17.
  • 18. Reading a file - Ruby
  • 20.
  • 21.
  • 22.
  • 24.
  • 25.
  • 26. Ruby on Rails • David Heinemeier Hansson (DHH) • Began via Basecamp in mid 2003 • Released July 2004 • Full Stack MVC Web Framework • Easy database-based web apps
  • 27. Accolades • 2006 Jolt award - Web Dev Tool • Featured in BusinessWeek, Wired • DHH “Best Hacker” award from Google
  • 28. Converts • Dave Thomas • Bruce Tate • Stuart Halloway • Justin Gehtland • David Geary • James Duncan Davidson
  • 29. “Rails is the most well thought-out web development framework I’ve ever used. And that’s in a decade of doing web applications for a living. I’ve built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before.” -James Duncan Davidson, Creator of Tomcat and Ant
  • 30. Platform • MySQL, PostgreSQL, SQLite, Oracle, SQL Server, DB2, or Firebird • develop anywhere • Apache or LightTPD + FastCGI for production
  • 31. * Done via intelligent reflection and metaprogramming * Emphasis on writing code to get stuff done - avoid boilerplate * Scaffolding handles left over boilerplate DRY - Don’t Repeat Yourself
  • 32. NO XML! Intelligent Defaults Only explicitly configure when necessary Convention over Configuration
  • 33. ActiveRecord An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
  • 34. Controller and View • ActionPack maps URLs to controller • View handled via Ruby in HTML (RHTML) or builders • Ajax provided via Prototype and RJS
  • 37. create table orders ( id int not null auto_increment, name varchar(100) not null, email varchar(255) not null, address text not null, pay_type char(10) not null, shipped_at datetime null, primary key (id) );
  • 38. class Order < ActiveRecord::Base end
  • 39. order = Order.new order.name = “Rob” order.email = “rob@yahoo.com” order.address = “123 1st St” order.save
  • 40. an_order = Order.find(24) robs_order = Order.find(:first, :conditions => "name = 'Rob'") rob_count = Order.count(:all, :conditions => “name = ‘Rob’”) robs_order = Order.find_by_name(“Rob”) more_orders = Order.find_all_by_name_and_pay_type(name, type) Order.delete(24) robs_order.destroy
  • 41. create table order_lines ( id int not null auto_increment, description varchar(100) not null, order_id int not null, primary key (id), constraint fk_order foreign key (order_id) references orders(id) );
  • 42. class Order < ActiveRecord::Base has_many :order_lines end class OrderLine < ActiveRecord::Base belongs_to :order end one to many bet ween orders and order lines “has_many” is actually a class level method call that generates instance methods
  • 43. my_order = Order.find(id) has_order_lines = my_order.order_lines? order_lines_count = my_order.order_lines.size my_order.order_lines.push(new_order, another_new_order) specific_order_line = my_order.find(....) specific_order_lnes = my_order.find_by_description(“abc”) my_line = OrderLine.find(15) has_owning_order = my_line.order.nil? old_order = my_line.order my_line.order= another_order
  • 45. quick summary Gross Income $ 0 Total Tax $ 0 Adjusted Gross Income $ 0 Total Payments $ 0 Total Deductions $ 16,400 Refund Amount $ * confirmation checks t wo 0 Total Taxable Income $ 0 Amount You Owe $ password0fields against each to file your 2005 federal extension, simply follow these instructions other STEP A - Once your e-filed extension has been accepted, you will acceptance is pattern of * receive an email with a confirmation number. Enter the confirmation number on your printed copy of Form 4868 and keep for your records. of ser vice/agreement terms checkbox STEP B - Since you indicated that you are not paying an amount with Form 4868, there is nothing to mail. For more information about tax, mortgage and financial services call 1-800-HRBLOCK or visit hrblock.com
  • 46. quick summary Gross Income $ 0 Total Tax $ 0 Adjusted Gross Income $ 0 Total Payments $ 0 Total Deductions $ 16,400 Refund Amount $ 0 Total Taxable Income $ 0 Amount You Owe $ 0 to file your 2005 federal extension, simply follow these instructions STEP A - Once your e-filed extension has been accepted, you will receive an email with a confirmation number. Enter the confirmation number on your printed copy of Form 4868 and keep for your records. STEP B - Since you indicated that you are not paying an amount with Form 4868, there is nothing to mail. For more information about tax, mortgage and financial services call 1-800-HRBLOCK or visit hrblock.com
  • 47. Much More... • many to many via has_many :through • eager loading • acts_as_list, acts_as_tree • single table inheritance • callbacks and observers
  • 49. http://url.com/weblog/ aka http://url.com/weblog/index.rhtml
  • 50. /app/controllers/weblog_controller.rb: class WeblogController < ActionController::Base layout "weblog/layout" def index @posts = Post.find_all end def display @post = Post.find(:params[:id]) ||= conditional assignment end operator def new cart is a non persistent model @post = Post.new object used for storing/calculating products end “the flash” = place to throw stuff def create like response messages, error @post = Post.create(params[:post]) reports that accumulate as a request is processed redirect_to :action => "display", :id => @post.id end end
  • 51. /app/views/weblog/layout.rhtml: <html><body> <%= @content_for_layout %> </body></html> /app/views/weblog/index.rhtml: <% for post in @posts %> <p><%= link_to(post.title, :action => "display", :id => post.id %></p> <% end %> /app/views/weblog/display.rhtml: <p> <b><%= post.title %></b><br/> <b><%= post.content %></b> </p> /app/views/weblog/new.rhtml: <%= form "post" %>
  • 53. ActionPack features • rxml - XML Builders • rhtml - HTML templates • helpers - module to assist the view • form and field helpers • layouts and partials - similiar to tiles • page caching and fragment caching
  • 54. ! &'())*+,%-.,//".0.1 !"#'4,+: ''!3&4$'('J&4$7!5,K"#$#%&B*+,CL "%! " "!$-0.2-&/ >D('?9$%E:#F'*#8:+95'(-'G&#A4G2'*+,'(-'!3&4$'D- >D(':4H:E!4I,'''''''''''G3&4$G2'G5#%4G''D->@"- >D(':4H:E!4I,'''''''''''G3&4$G2'G8935:$;G''D->@"- >D('"#&&<9$,E!4I,'G3&4$G2'G"#&&<9$,G''D->@"- 7'7'7 ! NO4'#""I+8#:+95'$484+A4&'#'$4P34&:' >D('45,E?9$%E:#F'D- :9'4,+:'#'3&4$7'Q:'$4#,&':O4',#:#'+5:9' #'54<'J&4$'%9,4I'9MR48:7 hash created with user attributes for easy " NO4'4,+:7$O:%I':4%"I#:4'+&'8#II4,7'Q:' update/save 3&4&':O4'+5?9$%#:+95'+5':O4'3&4$' 9MR48:':9'F454$#:4777 # >?9$%'#8:+95(6@%;#""@&#A4@./016- ''''>+5"3:'5#%4(63&4$B5#%4C6'777'- field helpers make input # :O4'SNTU'+&'&45:':9':O4'M$9<&4$7' ''''>+5"3:'5#%4(63&4$B8935:$;C6'777'- (s) easy ''''>+5"3:'5#%4(63&4$B"#&&<9$,C6'777'- VO45':O4'$4&"95&4'+&'$484+A4,777 ''''7'7'7 >@?9$%- $ :O4'"#$#%4:4$&'#$4'4H:$#8:4,'+5:9'#' 54&:4,'O#&O7' % NO4'&#A4'#8:+95'3&4&':O4' "#$#%4:4$&':9'!5,':O4'3&4$'$489$,' #5,'3",#:4'+:7 $ !"#$#%&'(') ''''*+,'(-'./012 ''''*3&4$'(-')' ''''''''*5#%4'(-'6'777'62' % !"#'&#A4 ''''''''*8935:$;'(-'6'777'62 ''''''''*"#&&<9$,'(-'6'777'6''= ''3&4$'('J&4$7!5,K"#$#%&B*+,CL = ''$#'3&4$73",#:4E#::$+M3:4&K"#$#%&B*3&4$CL '''''777 ''"%! "%! Figure 17.2: Models, Controllers, and Views Work Together
  • 55. Ajax Support • Ajax support built in since March ’05 • Built on Prototype and Scriptaculous • Updating forms and tables via Ajax is trivial • Best Ajax support of any web framework
  • 56. Other Stuff • Awesome Testing support built in • Generators/scaffolding • Migrations - refactor your database • Capistrano - automate deployment • Huge, helpful community
  • 57. But Does it Scale?
  • 58. Yes.
  • 59. • scales just like Yahoo! , LiveJournal, etc • share nothing • load balance to each tier • add servers as needed
  • 62. • Legacy databases • Tool support • Deployment is hard • Internationalization • Its different • Its advanced
  • 63. The Future • Rails growth will continue • Its influence is already felt everywhere • JRuby could be huge • Its biggest impact may be felt in future frameworks
  • 64. No mater what, its going to be a fun ride.