SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
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/

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von あしたのオープンソース研究所   (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 分散データベース
 

Kürzlich hochgeladen

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
[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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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...
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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...
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
[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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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/