SlideShare uma empresa Scribd logo
1 de 49
Baixar para ler offline
Rapid Web
Application
Development using
Ruby on Rails
●
 Sang Shin
●Sun Microsystems, Inc.

●
 javapassion.com

                          1
You can try all the demos
yourself!

Join “Ruby, JRuby, Rails”
free online course!

www.javapassion.com/rubyonrails
Topics
•   What is and Why Ruby on Rails (Rails)?
•   Rails Basics
•   Step by step for building “Hello World” Rails application
•   ActiveRecord
•   ActionController
•   ActionView
•   Deployment




                                                                3
What is and Why
Ruby on Rails (RoR)?
What Is “Ruby on Rails”?
• A full-stack MVC web development framework
• Written in Ruby
• First released in 2004 by
  David Heinemeier Hansson
• Gaining popularity




                                               5
“Ruby on Rails” Principles
• Convention over configuration
  > Why punish the common cases?
  > Encourages standard practices
  > Everything simpler and smaller
• Don’t Repeat Yourself (DRY)
  > Repetitive code is harmful to adaptability
• Agile development environment
  > No recompile, deploy, restart cycles
  > Simple tools to generate code quickly
  > Testing built into the framework
                                                 6
Rails Basics
“Ruby on Rails” MVC




                      source: http://www.ilug-cal.org   8
Step By Step Process
of Building “Hello World”
Rails Application
Steps to Follow
1.Create “Ruby on Rails” project
  > IDE generate necessary directories and files
2.Create and populate database tables
3.Create Models (through Rails Generator)
  > Migrate database
4.Create Controllers (through Rails Generator)
5.Create Views
6.Set URL Routing
  > Map URL to controller and action
                                                   10
Demo:
    Building “Hello World”
Rails Application Step by Step.

 http://www.javapassion.com/handsonlabs/rails_basics/#Exercise_1




                                                                   11
Key Learning Points
• How to create a Rails project
    > Rails application directory structure
    > Concept of environments - development, test, and
      production
•   How to create a database using Rake
•   How to create and populate tables using Migration
•   How to create a model using Generator
•   How to use Rails console

                                                         12
Key Learning Points
• How to create a controller using Generator
  > How to add actions to a controller
• How to create a related view
  > How a controller and a view are related
  > How to create instance variables in an action and they
    are used in a view
• How to set up a routing
• How to trouble-shoot a problem

                                                             13
Demo:
How to create an input form.

http://www.javapassion.com/handsonlabs/rails_basics/#Exercise_4




                                                                  14
Key Learning Points
• How to use form_tag and text_field helpers to
  create an input form
• How input form fields are accessed in an action
  method through params




                                                    15
Scaffolding
What is Scaffolding?
• Scaffolding is a way to quickly create a CRUD
  application
  > Rails framework generates a set of actions for listing,
    showing, creating, updating, and destroying objects of
    the class
  > These standardized actions come with both controller
    logic and default templates that through introspection
    already know which fields to display and which input
    types to use
• Supports RESTful view of the a Model
                                                              17
Demo:
Creating a Rails Application
     using Scaffolding

http://www.javapassion.com/handsonlabs/rails_scaffold/#Exercise_1




                                                                    18
Key Learning Points
• How to perform scaffolding using Generator
• What action methods are created through
  scaffolding
• What templates are created through scaffolding




                                                   19
ActiveRecord
Basics
ActiveRecord Basics
• Model (from MVC)
• Object Relation Mapping library
  > A table maps to a Ruby class (Model)
  > A row maps to a Ruby object
  > Columns map to attributes
• Database agnostic
• Your model class extends ActiveRecord::Base


                                                21
ActiveRecord Class
• Your model class extends ActiveRecord::Base
  class User < ActiveRecord::Base
  end
• You model class contain domain logic
  class User < ActiveRecord::Base
     def self.authenticate_safely(user_name, password)
      find(:first, :conditions => [ "user_name = ? AND
     password = ?", user_name, password ])
     end
  end                                                    22
Naming Conventions
• Table names are plural and class names are
  singular
  > posts (table), Post (class)
  > students (table), Student (class)
  > people (table), Person (class)
• Tables contain a column named id




                                               23
Find: Examples
• find by id
  Person.find(1)     # returns the object for ID = 1
  Person.find(1, 2, 6) # returns an array for objects with IDs in (1, 2, 6)
• find first
  Person.find(:first) # returns the first object fetched by SELECT * FROM peop
  Person.find(:first, :conditions => [ "user_name = ?", user_name])
  Person.find(:first, :order => "created_on DESC", :offset => 5)




                                                                              24
Dynamic attribute-based finders
• Dynamic attribute-based finders are a cleaner way
  of getting (and/or creating) objects by simple
  queries without turning to SQL
• They work by appending the name of an attribute to
  find_by_ or find_all_by_, so you get finders like
  > Person.find_by_user_name(user_name)
     > Person.find(:first, :conditions => ["user_name = ?",
       user_name])
  > Person.find_all_by_last_name(last_name)
     > Person.find(:all, :conditions => ["last_name = ?", last_name])
  > Payment.find_by_transaction_id
                                                                        25
ActiveRecord
Migration
ActiveRecord Migration
• Provides version control of database schema
  > Adding a new field to a table
  > Removing a field from an existing table
  > Changing the name of the column
  > Creating a new table
• Each change in schema is represented in pure
  Ruby code



                                                 27
Example: Migration
• Add a boolean flag to the accounts table and remove it
  again, if you’re backing out of the migration.

  class AddSsl < ActiveRecord::Migration
     def self.up
      add_column :accounts, :ssl_enabled, :boolean, :default => 1
     end

    def self.down
     remove_column :accounts, :ssl_enabled
    end
   end                                                       28
Demo:
How to add a field to a table
     using Migration

http://www.javapassion.com/handsonlabs/rails_scaffold/#Exercise_2




                                                                    29
Key Learning Points
• How to add a new field to a table using Migration
• How to create a migration file using Generator
• How to see a log file




                                                      30
ActiveRecord
Validation
ActiveRecord::Validations
• Validation methods
  class User < ActiveRecord::Base
   validates_presence_of :username, :level
   validates_uniqueness_of :username
   validates_oak_id :username
   validates_length_of :username, :maximum => 3, :allow_nil
   validates_numericality_of :value, :on => :create
  end


                                                          32
Validation




             33
Demo:
                 Validation
http://www.javapassion.com/handsonlabs/rails_scaffold/#2.4




                                                             34
ActiveRecord::
Associations
Associations
• Associations are a set of macro-like class methods
  for tying objects together through foreign keys.
• They express relationships like "Project has one
  Project Manager" or "Project belongs to a Portfolio".
• Each macro adds a number of methods to the class
  which are specialized according to the collection or
  association symbol and the options hash.
• Cardinality
  > One-to-one, One-to-many, Many-to-many
                                                          36
One-to-many
• Use has_many in the base, and belongs_to in the
  associated model

   class Manager < ActiveRecord::Base
    has_many :employees
   end
   class Employee < ActiveRecord::Base
    belongs_to :manager # foreign key - manager_id
   end
                                                     37
Demo:
               Association
http://www.javapassion.com/handsonlabs/rails_activerecord/




                                                             38
ActionController
Basics
ActionController
• Controller is made up of one or more actions that are
  executed on request and then either render a template or
  redirect to another action
• An action is defined as a public method on the controller,
  which will automatically be made accessible to the web-
  server through Rails Routes
• Actions, by default, render a template in the app/views
  directory corresponding to the name of the controller and
  action after executing code in the action.


                                                               40
ActionController
• For example, the index action of the GuestBookController would
  render the template app/views/guestbook/index.erb by default
  after populating the @entries instance variable.

  class GuestBookController < ActionController::Base
     def index
      @entries = Entry.find(:all)
     end

    def sign
     Entry.create(params[:entry])
     redirect_to :action => "index"
    end
   end
                                                               41
Deployment
Web Servers
• By default, Rails will try to use Mongrel and lighttpd
  if they are installed, otherwise Rails will use
  WEBrick, the webserver that ships with Ruby.
• Java Server integration
  > Goldspike
  > GlassFish V3




                                                           43
Goldspike
• Rails Plugin
• Packages Rails application as WAR
• WAR contains a servlet that translates data from the
  servlet request to the Rails dispatcher
• Works for any servlet container
• rake war:standalone:create



                                                     44
Demo:
        Deployment through
            Goldspike

http://www.javapassion.com/handsonlabs/rails_deploy/#Exercise_1




                                                                  45
JRuby on Rails
Why “JRuby on Rails”
over “Ruby on Rails”?
• Java technology production environments pervasive
  > Easier to switch framework vs. whole architecture
  > Lower barrier to entry
• Integration with Java technology libraries,
  legacy services
• No need to leave Java technology servers, libraries,
  reliability
• Deployment to Java application servers
                                                         47
“JRuby on Rails”: Java EE Platform
• Pool database connections
• Access any Java Naming and Directory Interface™
  (J.N.D.I.) API resource
• Access any Java EE platform TLA:
  > Java Persistence API (JPA)
  > Java Management Extensions (JMX™)
  > Enterprise JavaBeans™ (EJB™)
  > Java Message Service (JMS) API
  > SOAP/WSDL/SOA
                                                    48
Rapid Web
Application
Development using
Ruby on Rails
●
 Sang Shin
●Sun Microsystems, Inc.

●
 javapassion.com

                          49

Mais conteúdo relacionado

Mais procurados

MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Levelbalassaitis
 
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your ApplicationsThe Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your Applicationsbalassaitis
 
25 Real Life Tips In Ruby on Rails Development
25 Real Life Tips In Ruby on Rails Development25 Real Life Tips In Ruby on Rails Development
25 Real Life Tips In Ruby on Rails DevelopmentBelighted
 
Apex Code Analysis Using the Tooling API and Canvas
Apex Code Analysis Using the Tooling API and CanvasApex Code Analysis Using the Tooling API and Canvas
Apex Code Analysis Using the Tooling API and CanvasSalesforce Developers
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patternsAlex Theedom
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGMarakana Inc.
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014Henry Van Styn
 
Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017Henry Van Styn
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)lazyatom
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design PatternsAlex Theedom
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitMax Katz
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPMohammad Shaker
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldMarakana Inc.
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Marakana Inc.
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldMarakana Inc.
 

Mais procurados (20)

MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
 
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your ApplicationsThe Grid the Brad and the Ugly: Using Grids to Improve Your Applications
The Grid the Brad and the Ugly: Using Grids to Improve Your Applications
 
25 Real Life Tips In Ruby on Rails Development
25 Real Life Tips In Ruby on Rails Development25 Real Life Tips In Ruby on Rails Development
25 Real Life Tips In Ruby on Rails Development
 
Apex Code Analysis Using the Tooling API and Canvas
Apex Code Analysis Using the Tooling API and CanvasApex Code Analysis Using the Tooling API and Canvas
Apex Code Analysis Using the Tooling API and Canvas
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUG
 
Rails Best Practices
Rails Best PracticesRails Best Practices
Rails Best Practices
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014
 
Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017Rapi::Blog talk - TPC 2017
Rapi::Blog talk - TPC 2017
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)
 
Handlebars & Require JS
Handlebars  & Require JSHandlebars  & Require JS
Handlebars & Require JS
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design Patterns
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
 
jQuery
jQueryjQuery
jQuery
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
 

Semelhante a td_mxc_rubyrails_shin

Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Rails Tips and Best Practices
Rails Tips and Best PracticesRails Tips and Best Practices
Rails Tips and Best PracticesDavid Keener
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantNitin Sawant
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Viral Solani
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsandyinthecloud
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpChalermpon Areepong
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to railsEvgeniy Hinyuk
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukPivorak MeetUp
 
DDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVCDDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVCAndy Butland
 

Semelhante a td_mxc_rubyrails_shin (20)

Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Rails Tips and Best Practices
Rails Tips and Best PracticesRails Tips and Best Practices
Rails Tips and Best Practices
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Codeinator
CodeinatorCodeinator
Codeinator
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 
12 Introduction to Rails
12 Introduction to Rails12 Introduction to Rails
12 Introduction to Rails
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
 
End_to_End_DevOps.pptx
End_to_End_DevOps.pptxEnd_to_End_DevOps.pptx
End_to_End_DevOps.pptx
 
DDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVCDDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVC
 

Mais de tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

Mais de tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

td_mxc_rubyrails_shin

  • 1. Rapid Web Application Development using Ruby on Rails ● Sang Shin ●Sun Microsystems, Inc. ● javapassion.com 1
  • 2. You can try all the demos yourself! Join “Ruby, JRuby, Rails” free online course! www.javapassion.com/rubyonrails
  • 3. Topics • What is and Why Ruby on Rails (Rails)? • Rails Basics • Step by step for building “Hello World” Rails application • ActiveRecord • ActionController • ActionView • Deployment 3
  • 4. What is and Why Ruby on Rails (RoR)?
  • 5. What Is “Ruby on Rails”? • A full-stack MVC web development framework • Written in Ruby • First released in 2004 by David Heinemeier Hansson • Gaining popularity 5
  • 6. “Ruby on Rails” Principles • Convention over configuration > Why punish the common cases? > Encourages standard practices > Everything simpler and smaller • Don’t Repeat Yourself (DRY) > Repetitive code is harmful to adaptability • Agile development environment > No recompile, deploy, restart cycles > Simple tools to generate code quickly > Testing built into the framework 6
  • 8. “Ruby on Rails” MVC source: http://www.ilug-cal.org 8
  • 9. Step By Step Process of Building “Hello World” Rails Application
  • 10. Steps to Follow 1.Create “Ruby on Rails” project > IDE generate necessary directories and files 2.Create and populate database tables 3.Create Models (through Rails Generator) > Migrate database 4.Create Controllers (through Rails Generator) 5.Create Views 6.Set URL Routing > Map URL to controller and action 10
  • 11. Demo: Building “Hello World” Rails Application Step by Step. http://www.javapassion.com/handsonlabs/rails_basics/#Exercise_1 11
  • 12. Key Learning Points • How to create a Rails project > Rails application directory structure > Concept of environments - development, test, and production • How to create a database using Rake • How to create and populate tables using Migration • How to create a model using Generator • How to use Rails console 12
  • 13. Key Learning Points • How to create a controller using Generator > How to add actions to a controller • How to create a related view > How a controller and a view are related > How to create instance variables in an action and they are used in a view • How to set up a routing • How to trouble-shoot a problem 13
  • 14. Demo: How to create an input form. http://www.javapassion.com/handsonlabs/rails_basics/#Exercise_4 14
  • 15. Key Learning Points • How to use form_tag and text_field helpers to create an input form • How input form fields are accessed in an action method through params 15
  • 17. What is Scaffolding? • Scaffolding is a way to quickly create a CRUD application > Rails framework generates a set of actions for listing, showing, creating, updating, and destroying objects of the class > These standardized actions come with both controller logic and default templates that through introspection already know which fields to display and which input types to use • Supports RESTful view of the a Model 17
  • 18. Demo: Creating a Rails Application using Scaffolding http://www.javapassion.com/handsonlabs/rails_scaffold/#Exercise_1 18
  • 19. Key Learning Points • How to perform scaffolding using Generator • What action methods are created through scaffolding • What templates are created through scaffolding 19
  • 21. ActiveRecord Basics • Model (from MVC) • Object Relation Mapping library > A table maps to a Ruby class (Model) > A row maps to a Ruby object > Columns map to attributes • Database agnostic • Your model class extends ActiveRecord::Base 21
  • 22. ActiveRecord Class • Your model class extends ActiveRecord::Base class User < ActiveRecord::Base end • You model class contain domain logic class User < ActiveRecord::Base def self.authenticate_safely(user_name, password) find(:first, :conditions => [ "user_name = ? AND password = ?", user_name, password ]) end end 22
  • 23. Naming Conventions • Table names are plural and class names are singular > posts (table), Post (class) > students (table), Student (class) > people (table), Person (class) • Tables contain a column named id 23
  • 24. Find: Examples • find by id Person.find(1) # returns the object for ID = 1 Person.find(1, 2, 6) # returns an array for objects with IDs in (1, 2, 6) • find first Person.find(:first) # returns the first object fetched by SELECT * FROM peop Person.find(:first, :conditions => [ "user_name = ?", user_name]) Person.find(:first, :order => "created_on DESC", :offset => 5) 24
  • 25. Dynamic attribute-based finders • Dynamic attribute-based finders are a cleaner way of getting (and/or creating) objects by simple queries without turning to SQL • They work by appending the name of an attribute to find_by_ or find_all_by_, so you get finders like > Person.find_by_user_name(user_name) > Person.find(:first, :conditions => ["user_name = ?", user_name]) > Person.find_all_by_last_name(last_name) > Person.find(:all, :conditions => ["last_name = ?", last_name]) > Payment.find_by_transaction_id 25
  • 27. ActiveRecord Migration • Provides version control of database schema > Adding a new field to a table > Removing a field from an existing table > Changing the name of the column > Creating a new table • Each change in schema is represented in pure Ruby code 27
  • 28. Example: Migration • Add a boolean flag to the accounts table and remove it again, if you’re backing out of the migration. class AddSsl < ActiveRecord::Migration def self.up add_column :accounts, :ssl_enabled, :boolean, :default => 1 end def self.down remove_column :accounts, :ssl_enabled end end 28
  • 29. Demo: How to add a field to a table using Migration http://www.javapassion.com/handsonlabs/rails_scaffold/#Exercise_2 29
  • 30. Key Learning Points • How to add a new field to a table using Migration • How to create a migration file using Generator • How to see a log file 30
  • 32. ActiveRecord::Validations • Validation methods class User < ActiveRecord::Base validates_presence_of :username, :level validates_uniqueness_of :username validates_oak_id :username validates_length_of :username, :maximum => 3, :allow_nil validates_numericality_of :value, :on => :create end 32
  • 34. Demo: Validation http://www.javapassion.com/handsonlabs/rails_scaffold/#2.4 34
  • 36. Associations • Associations are a set of macro-like class methods for tying objects together through foreign keys. • They express relationships like "Project has one Project Manager" or "Project belongs to a Portfolio". • Each macro adds a number of methods to the class which are specialized according to the collection or association symbol and the options hash. • Cardinality > One-to-one, One-to-many, Many-to-many 36
  • 37. One-to-many • Use has_many in the base, and belongs_to in the associated model class Manager < ActiveRecord::Base has_many :employees end class Employee < ActiveRecord::Base belongs_to :manager # foreign key - manager_id end 37
  • 38. Demo: Association http://www.javapassion.com/handsonlabs/rails_activerecord/ 38
  • 40. ActionController • Controller is made up of one or more actions that are executed on request and then either render a template or redirect to another action • An action is defined as a public method on the controller, which will automatically be made accessible to the web- server through Rails Routes • Actions, by default, render a template in the app/views directory corresponding to the name of the controller and action after executing code in the action. 40
  • 41. ActionController • For example, the index action of the GuestBookController would render the template app/views/guestbook/index.erb by default after populating the @entries instance variable. class GuestBookController < ActionController::Base def index @entries = Entry.find(:all) end def sign Entry.create(params[:entry]) redirect_to :action => "index" end end 41
  • 43. Web Servers • By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise Rails will use WEBrick, the webserver that ships with Ruby. • Java Server integration > Goldspike > GlassFish V3 43
  • 44. Goldspike • Rails Plugin • Packages Rails application as WAR • WAR contains a servlet that translates data from the servlet request to the Rails dispatcher • Works for any servlet container • rake war:standalone:create 44
  • 45. Demo: Deployment through Goldspike http://www.javapassion.com/handsonlabs/rails_deploy/#Exercise_1 45
  • 47. Why “JRuby on Rails” over “Ruby on Rails”? • Java technology production environments pervasive > Easier to switch framework vs. whole architecture > Lower barrier to entry • Integration with Java technology libraries, legacy services • No need to leave Java technology servers, libraries, reliability • Deployment to Java application servers 47
  • 48. “JRuby on Rails”: Java EE Platform • Pool database connections • Access any Java Naming and Directory Interface™ (J.N.D.I.) API resource • Access any Java EE platform TLA: > Java Persistence API (JPA) > Java Management Extensions (JMX™) > Enterprise JavaBeans™ (EJB™) > Java Message Service (JMS) API > SOAP/WSDL/SOA 48
  • 49. Rapid Web Application Development using Ruby on Rails ● Sang Shin ●Sun Microsystems, Inc. ● javapassion.com 49