O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

JavaScript Applications on top of Ruby on Rails

4.092 visualizações

Publicada em

Slides of my talk a the Ruby User Group Berlin on March 1st, 2012

You may easily download the slides as PDF here:

Publicada em: Tecnologia
  • Seja o primeiro a comentar

JavaScript Applications on top of Ruby on Rails

  1. 1. JAVASCRIPT APPLICATIONS ON TOP OF RAILS Mathias Schäfer (9elements) Ruby User Group Berlin
  2. 2. CHAPLINhttps://github.com/moviepilot/chaplin
  3. 3. CHAPLIN A JavaScript Application Architecture on top of Backbone.js MVC, Mediator & Publish/SubscribeConvention over Configuration & DRY RequireJS / AMD
  4. 4. MOVIEPILOT.COM Discover Movies First
  5. 5. MOVIEPILOT.COMA spin-off targeting the international (English-speaking) marketWhole new concept compared to Moviepilot.deSingle-Page-ApplicationHTML templating, login etc. on the clientFat Client, Slim Application Server
  6. 6. SINGLE-PAGE APPSLook & Feel of an AppSnappy user interfaceMuch client-side interactionAjax polling and Websockets pushingAlternatives: read DHH on Basecamp (bit.ly/xGADFJ)
  7. 7. moviepilot.com JavaScript App moviepilot.com Rails app Edward Rails JSON API Sheldon MySQL Neo4J on jRuby
  8. 8. RAILS FOR JAVASCRIPT APPSRails is an excellent platform to deliver JavaScript applicationsRails Asset Pipeline: “Fast by default”Compilation & Packaging of CoffeeScript, Sass/Compass
  9. 9. DUAL-USE APISRails is an excellent choice for JSON APIsQuery them from other (Rails) componentsor directly from the clientProper URLs and search-engine accessibilityRender a minimal page on the server,then load the JavaScript app on top
  10. 10. LEARNING FROM RUBY FRAMEWORKSBuilding a proper MVC architecture on top of Backbone.jsBackbone.js is minimalistic and its MVC approach is… funkyLearn from Rails Routing (routes.rb) and Controllers (actions,params)Of course client-side MVC ist not the same, e.g. REST/CRUDworks differentlyDuplicate stack: MVC on server – MVC on client
  11. 11. RB + JS = <3Rails has made tremendous efforts to support JavaScriptapplication development (Rails Asset Pipeline, CoffeeScript…)ECMAScript 6 will borrow several ideas of the Ruby languageRuby developers, embrace JavaScript!JavaScript developers, embrace Ruby!
  12. 12. THANKS!@molily on Twitter and Githubhttp://molily.de/http://9elements.com/http://moviepilot.com/https://github.com/moviepilot/chaplin