SlideShare a Scribd company logo
1 of 39
Download to read offline
Ruby on Rails
Ruby on Rails
—                     Web                     	
      —  RoR         Rails        	
      —  Ruby                	
      —  MVC                           	

—  Rails        	
       	
                                         Wikipedia
Rails              	
—  David Heinemeier Hansson        	
    	
                  basecamp”
                                                   	
  —                           	
  —                                     	
  —                                 	
  —                                 	
  — 
Rails               	




        ⇛ http://rubyonrails.org/applications
Rails           	
                      Rails
          Web



        Rails        Web          p.2	


                       —  Ajax
                       —  REST
Rails                 	
                 DRY Don’t Repeat Yourself
                                        	
       —                                        	



             CoC Convention over Configuration
                                    	
 —                    MVC
Rails MVC                                            	
—  Model
    	
                       MVC Web                    Model RDBMS
                                         Rails   Active Record
     Model                                 ActiveRecord::Base
                                              RDBMS
                                                                 	

—  View
         MVC        View
                                                   Web
         HTML                                                	

—  Controller
         MVC        Controller Rails Action Pack
                                          Web      MVC
         Web
               	
                                                         Wikipedia
Active Record
—  Active Record = Rails               ORM   	
       	
                              ActiveRecord RDBMS
                                                   RDBMS
                                                           	
         Wikipedia 2011.4.4        	
  	

—  ORM Object-Relational Mapping 	
  — 
Action Pack	
—  Action Pack = Action Controller + Action View
  —  Action Pack   Rails                    	
  — 
Action Controller
Action View	
—  Helper



—           	



— 
RESTful   web
REST          Representational State Transfer           	
 
—  REST

  Wikipedia

—  2000     HTTP                               Roy
    Fielding                                       	

—  REST
                    XML
                      HTTP
                      Web            SOAP
       MEP Message Exchange Pattern; SOAP


                                  Wikipedia
REST                                   	
REST                  2                                   	

—  Fielding REST
    Web                	

—  RPC                     XML+HTTP
                    (SOAP       )



                                            Wikipedia
RESTful                     web             	
 
—                                     	

—              HTTP         	
      —    GET
      —    PUT
      —    POST
      —    DELETE

—                     	
      —  URL
RESTful    web           	
 
—  Web



—  Web



—  REST     Web
               or   or
COM CORBA                                       	
—  Web              COM CORBA                       	

—           Web
                                  RESTful Web
      p.ix

—             HTTP
                 Web
                 HTTP            XML



             p.xii
SOAP vs. REST	
—  SOAP REST                                     	

—  2002     Amazon Web                 	
      —  SOAP    REST                                 	
      —          SOAP    REST                    	
      —      SOAP REST                      	


—                Web2.0 Google        Amazon          REST        	
      —  REST                                         	
      —  SOAP                                                	
      —         REST             	

                                             Web                   pp.22-24
RESTful                                   	
—                            

      

      


                                    RESTful
                    RESTful

                                          

      	
          Rails   Web             p.378
RESTful                             	
—                      

      

      

          REST
                            RESTful


                                         

      	
          Rails   Web       p.379
RESTful                          	
—  Amazon.com …                        REST
         SOAP                    REST
                       	

—  eBay…REST                            	

—  Yahoo!…REST                               	

—  Zope                    	

—         	

                                         Wikipedia
Rails                REST                        	
—  Restlet Java
     RESTful                 

        Lightweight)Java           	


—  Django Python
   	
                       Web              

                    MVC                 	


—  BEAR PHP
   	
                       PHP5    

                   DI Web
Rails 3
Rails3                        	
—  Action Dispatch

—  Bundler & Action Mailer

—  Active Relation & Active Model

—  Cross-site scripting & Unobtrusive JavaScript

—  New Action Controller
Dive into Rails 3
Action Dispatch	
—  Action Dispatch contains a new syntax for routing which
    is even more concise and readable.
Bundler & Action Mailer	
—  Rails 3 ships with Bundler, a Ruby library that makes
    Dependency Management a painless process.
Active Relation & Active Model	
—  Active Relation gives you a more powerful syntax for
    pulling data into your application. We'll learn about the
    new syntax and discover how to leverage Active Model to
    enhance our plain old Ruby objects.
Cross-site scripting &
Unobtrusive JavaScript	
—  Cross-site scripting (XSS) protection has been improved
    in Rails 3. Html 5 standards have also been adopted to
    encourage unobtrusive javascript and allow for seamless
    integration of any Javascript Framework.
New Action Controller	
—  The Action Controller stack has been completely
    overhauled to allow for increased modularity and code
    reuse. We'll learn about Abstract Controller and the new
    respond_to syntax to help simplify RESTful controllers.
Rails                          	
—  Ruby
  —  Rails                    or 1.9.2
  —  Mac OS X 10.5                       	


—  RubyGems
  —  Ruby                	


—  Rails
  —  gem install rails
Rails                                   	
—  Mac OS X                        Ruby      Rails
                                    Rails     RubyGems        	
      —  sudo gem update --system	
      —  sudo gem install rails	

—                                          fetch              	
      —  gem list …                                     	
      —  gem server
      —  http://localhost:8088 …
expenses

—  rails new expenses	

—  cd expenses

—  rails server

—  http://localhost:3000
Hello, Rails!	

                                     Hello, World!

        —  rails generate controller Say	

        —  cd expenses

        —  rails server

        —  http://localhost:3000
1.                           	

2.        URL   Rails             	

3.  URL                      	

4.                                          	

5.  ERb                                	

6. 
Manifesto for Agile Software Development
	
     We are uncovering better ways of developing
      software by doing it and helping others do it.
       Through this work we have come to value:

   —  Individuals and interactions over processes and tools

   —  Working software over comprehensive documentation

    —  Customer collaboration over contract negotiation

       —  Responding to change over following a plan

       That is, while there is value in the items on
      the right, we value the items on the left more.

                http://agilemanifesto.org/
—                                    	

—                                                	

             —                         	

      — 




            http://agilemanifesto.org/iso/ja/

More Related Content

Similar to Rails.20110405

RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRuby Bangladesh
 
Standards for Semantic Mashups
Standards for Semantic MashupsStandards for Semantic Mashups
Standards for Semantic MashupsLaurent Lefort
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 
SQL Data Service Overview
SQL Data Service OverviewSQL Data Service Overview
SQL Data Service OverviewEric Nelson
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & BackboneAshan Fernando
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptmartinlippert
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)sirthias
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworksukdpe
 
Sociable Software
Sociable SoftwareSociable Software
Sociable Softwarekamaelian
 
Ruby on rails vs asp.net mvc
Ruby on rails vs asp.net mvcRuby on rails vs asp.net mvc
Ruby on rails vs asp.net mvcUmar Ali
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011Fabio Akita
 
09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do railsDNAD
 
Angular JS and Magento
Angular JS and MagentoAngular JS and Magento
Angular JS and MagentoVinci Rufus
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on RailsKarel Minarik
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsousli07
 
How to build truly scalable Rails apps
How to build truly scalable Rails appsHow to build truly scalable Rails apps
How to build truly scalable Rails appsKazuki MATSUMOTO
 

Similar to Rails.20110405 (20)

RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
 
Standards for Semantic Mashups
Standards for Semantic MashupsStandards for Semantic Mashups
Standards for Semantic Mashups
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 
SQL Data Service Overview
SQL Data Service OverviewSQL Data Service Overview
SQL Data Service Overview
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & Backbone
 
JAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScriptJAX 2012: Moderne Architektur mit Spring und JavaScript
JAX 2012: Moderne Architektur mit Spring und JavaScript
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
 
Sociable Software
Sociable SoftwareSociable Software
Sociable Software
 
Ro r
Ro rRo r
Ro r
 
MongoTokyo
MongoTokyoMongoTokyo
MongoTokyo
 
Ruby on rails vs asp.net mvc
Ruby on rails vs asp.net mvcRuby on rails vs asp.net mvc
Ruby on rails vs asp.net mvc
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011
 
09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails
 
Angular JS and Magento
Angular JS and MagentoAngular JS and Magento
Angular JS and Magento
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on Rails
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
How to build truly scalable Rails apps
How to build truly scalable Rails appsHow to build truly scalable Rails apps
How to build truly scalable Rails apps
 

More from あしたのオープンソース研究所   (13)

Apache Hive 紹介
Apache Hive 紹介Apache Hive 紹介
Apache Hive 紹介
 
Datomic&datalog紹介
Datomic&datalog紹介Datomic&datalog紹介
Datomic&datalog紹介
 
Red5
Red5Red5
Red5
 
Friendica_28th_AshitanoKen
Friendica_28th_AshitanoKenFriendica_28th_AshitanoKen
Friendica_28th_AshitanoKen
 
Apache UIMA
Apache UIMAApache UIMA
Apache UIMA
 
Flume
FlumeFlume
Flume
 
Gephi Quick Start (Japanese)
Gephi Quick Start (Japanese)Gephi Quick Start (Japanese)
Gephi Quick Start (Japanese)
 
Gephi Tutorial Visualization (Japanese)
Gephi Tutorial Visualization (Japanese)Gephi Tutorial Visualization (Japanese)
Gephi Tutorial Visualization (Japanese)
 
Cassandra v0.6-siryou
Cassandra v0.6-siryouCassandra v0.6-siryou
Cassandra v0.6-siryou
 
S4
S4S4
S4
 
machine learning & apache mahout
machine learning & apache mahoutmachine learning & apache mahout
machine learning & apache mahout
 
20100831.あしたの研第14回座談会moses.スライド
20100831.あしたの研第14回座談会moses.スライド20100831.あしたの研第14回座談会moses.スライド
20100831.あしたの研第14回座談会moses.スライド
 
Cassandra 分散データベース
Cassandra 分散データベースCassandra 分散データベース
Cassandra 分散データベース
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Rails.20110405

  • 2. Ruby on Rails —  Web —  RoR Rails —  Ruby —  MVC —  Rails Wikipedia
  • 3. Rails —  David Heinemeier Hansson basecamp” —  —  —  —  — 
  • 4. Rails ⇛ http://rubyonrails.org/applications
  • 5. Rails Rails Web Rails Web p.2 —  Ajax —  REST
  • 6. Rails DRY Don’t Repeat Yourself —  CoC Convention over Configuration —  MVC
  • 7. Rails MVC —  Model MVC Web Model RDBMS Rails Active Record Model ActiveRecord::Base RDBMS —  View MVC View Web HTML —  Controller MVC Controller Rails Action Pack Web MVC Web Wikipedia
  • 8. Active Record —  Active Record = Rails ORM ActiveRecord RDBMS RDBMS Wikipedia 2011.4.4 —  ORM Object-Relational Mapping — 
  • 9. Action Pack —  Action Pack = Action Controller + Action View —  Action Pack Rails — 
  • 12. RESTful web
  • 13. REST Representational State Transfer —  REST Wikipedia —  2000 HTTP Roy Fielding —  REST XML HTTP Web SOAP MEP Message Exchange Pattern; SOAP Wikipedia
  • 14. REST REST 2 —  Fielding REST Web —  RPC XML+HTTP (SOAP ) Wikipedia
  • 15. RESTful web —  —  HTTP —  GET —  PUT —  POST —  DELETE —  —  URL
  • 16. RESTful web —  Web —  Web —  REST Web or or
  • 17. COM CORBA —  Web COM CORBA —  Web RESTful Web p.ix —  HTTP Web HTTP XML p.xii
  • 18. SOAP vs. REST —  SOAP REST —  2002 Amazon Web —  SOAP REST —  SOAP REST —  SOAP REST —  Web2.0 Google Amazon REST —  REST —  SOAP —  REST Web pp.22-24
  • 19. RESTful —  
 
 
 RESTful RESTful 
 Rails Web p.378
  • 20. RESTful —  
 
 
 REST RESTful 
 Rails Web p.379
  • 21. RESTful —  Amazon.com … REST SOAP REST —  eBay…REST —  Yahoo!…REST —  Zope —  Wikipedia
  • 22. Rails REST —  Restlet Java RESTful 
 Lightweight)Java —  Django Python Web 
 MVC —  BEAR PHP PHP5 
 DI Web
  • 24. Rails3 —  Action Dispatch —  Bundler & Action Mailer —  Active Relation & Active Model —  Cross-site scripting & Unobtrusive JavaScript —  New Action Controller
  • 26. Action Dispatch —  Action Dispatch contains a new syntax for routing which is even more concise and readable.
  • 27. Bundler & Action Mailer —  Rails 3 ships with Bundler, a Ruby library that makes Dependency Management a painless process.
  • 28. Active Relation & Active Model —  Active Relation gives you a more powerful syntax for pulling data into your application. We'll learn about the new syntax and discover how to leverage Active Model to enhance our plain old Ruby objects.
  • 29. Cross-site scripting & Unobtrusive JavaScript —  Cross-site scripting (XSS) protection has been improved in Rails 3. Html 5 standards have also been adopted to encourage unobtrusive javascript and allow for seamless integration of any Javascript Framework.
  • 30. New Action Controller —  The Action Controller stack has been completely overhauled to allow for increased modularity and code reuse. We'll learn about Abstract Controller and the new respond_to syntax to help simplify RESTful controllers.
  • 31.
  • 32. Rails —  Ruby —  Rails or 1.9.2 —  Mac OS X 10.5 —  RubyGems —  Ruby —  Rails —  gem install rails
  • 33. Rails —  Mac OS X Ruby Rails Rails RubyGems —  sudo gem update --system —  sudo gem install rails —  fetch —  gem list … —  gem server —  http://localhost:8088 …
  • 34. expenses —  rails new expenses —  cd expenses —  rails server —  http://localhost:3000
  • 35.
  • 36. Hello, Rails! Hello, World! —  rails generate controller Say —  cd expenses —  rails server —  http://localhost:3000
  • 37. 1.  2.  URL Rails 3.  URL 4.  5.  ERb 6. 
  • 38. Manifesto for Agile Software Development We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: —  Individuals and interactions over processes and tools —  Working software over comprehensive documentation —  Customer collaboration over contract negotiation —  Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more. http://agilemanifesto.org/
  • 39. —  —  —  —  http://agilemanifesto.org/iso/ja/