SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
Angular.js + Rails = ♥
   or: The Accidental Feature
By Jonathan E. Magen / @yonkeltron Sr. Software Engineer, WeWork
Identify yourself
Jonathan E. Magen / yonkeltron errywhere else
Practitioner of the Computer Sciences
Research @ The Evergreen State College Advanced OS Lab
WeWork engineer
About WeWork
“ We want to change the way people work. ”
        - Adam Neumann, WeWork Co-Founder


     “ Design to make people happy. ”
        - Miguel McKelvey, WeWork Co-Founder


        7 Buildings
        3 Cities
        4000+ Members
        Services for the community
Computing at WeWork
      Tech stack
        Rails
        Heroku
        PostgreSQL
         Agile!
WeWork.com Member
    Network
Spaceman: WeWork
backoffice hawtness
   Space management
   Billing
   Reservations
   Accounting system integration
Things we've built with
       Angular
Audit trail + changelog inspector using audited gem
Infinite scroll using will_paginate gem
Inline edit
Lots of stuff using ngResource
Angular.js + Rails
       ♥
Free RESTful JSON endpoints
casOfrnsotolr<Apiainotolr
ls feigCnrle   plctoCnrle

 dfidx
  e ne
   @feig =Ofrn.aeprm[pg]
    ofrns feigpg(aas:ae)

   rsodt d |omt
    epn_o o fra|
     fra.tl#idxhm.r
      omthm  ne.tleb
     fra.sn{rne jo:@feig,ro:fle}
      omtjo  edr sn ofrns ot as
   ed
    n
 ed
  n

 #ohratos.
   te cin..
ed
n




              ActiveRecord → JSON → HTTP
ngResource
aglrmdl(ofrnsevc' [nRsuc')
nua.oue'feigSrie, 'geore].
 fcoy'feig,fnto ofrn(rsuc){
  atr(Ofrn' ucin feig$eore
   rtr $eore'ofrns:d,{d 'i',{
    eun rsuc(/feig/i' i: @d}
     cet:{mto:'OT }
      rae  ehd PS' ,
     idx {mto:'E' iAry tu }
      ne:  ehd GT, sra: re ,
     so: {mto:'E'}
      hw   ehd GT ,
     udt:{mto:'U'}
      pae  ehd PT
   };
    )
 };
  )




          Rails → JSON/HTTP → ngResource
Rails renders Angular template HTML
          Times you might want to do this:
    Permissions: only rendering parts of a template
    Dynamically populate form s l c options
                                eet
    Internationalization!
Permission-driven rendering
   <=i cretue.a_oe :uio %
    % f urn_srhsrl? adtr >
     <i dt-gap"pcmn>
      dv aan-p=saea"
       <i dt-uis"e"
        dv aaadt=yp
          dt-uial-ye"% Ofrn.os%"
           aaadtbetp=<= feigt_ >
          dt-uial-d"% @feigi %"<dv
           aaadtbei=<= ofrn.d >>/i>
     <dv
      /i>
   < ed%
    % n >




Only render the audit inspector directive iff the current user has the
                authorization to access audit data
i18n API column headers
 <al cas"al tbesrpd dt-gap"pcmn>
 tbe ls=tbe al-tie" aan-p=saea"
  <ha>
   ted
    <h<=Ofrn.ua_trbt_ae:ae %<t>
     t>% feighmnatiuenm(nm) >/h
    <h<=Ofrn.ua_trbt_ae:aeoiain %<t>
     t>% feighmnatiuenm(ctgrzto) >/h
    <h<=Ofrn.ua_trbt_ae:rc)%<t>
     t>% feighmnatiuenm(pie >/h
    <h<t>
     t>/h
    <h<t>
     t>/h
  <ted
   /ha>




t e drendered by Rails includes localized column headers. This
 ha
    lets Angular render the t o ycontaining actual data.
                             bd
One minor snag
cni.sesj_opesr=Srces:ayopesrnwd
ofgast.scmrso    pokt:LzCmrso.e o
 Ulfe.e(age fle #dntoltrt nms
  giirnwmnl: as)  o' bieae ae
ed
n




         config/environments/production.rb
Angular on Rails
Rails gives you RESTful JSON endpoints for free
ngResource lets you consume them for free
Let Rails help you render templates
The Accidental Feature
It started with a spike
                       The requirement:
Allow a user to quickly inline edit inventory on the index page.




                      *Actual Spaceman wireframe
The search for
  inline edit
   Oh God, please make it stop
Yeah, I know there were easier
         ways to do this
        Gorillions of jQuery plugins
        Far fewer Angular-friendly options
           Google Groups
           StackOverflow
 We knew we'd need Angular.js but
 wanted to ease our way in gradually
A subtle rejection of ngGrid
        Reimplementing t b ein terms of d v
                          al             i
        Does way more than what we needed
        Sub project of Angular UI
TBH: Angular.js could really use widgets
               Web Components?
How we did it
Offerings controller
saea.otolr'feig' fnto (soe sacPrmevc,Ofrn){
pcmncnrle(ofrns, ucin $cp, erhaaSrie feig
 cnoelg'feig Cnolr)
  osl.o(Ofrns otle';

 $cp.feig =Ofrn.ur(;/ nRsuc ZM!
  soeofrns  feigqey) / geore OG

 $cp.dtnTgl =fnto eiigogeofrn){
  soeeiigoge    ucin dtnTgl(feig
   i (feigeiig {
    f ofrn.dtn)
     Ofrn.paeofrn)
      feigudt(feig;
     ofrn.dtn =fle
      feigeiig  as;
   }es {
      le
     ofrn.dtn =tu;
      feigeiig  re
   }
 };
};
)
The show/hide model for cells
      in the table body
 <bd dt-gcnrle=ofrns>
 toy aan-otolr"feig"
  <rdt-grpa=ofrn i ofrns>
   t aan-eet"feig n feig"
    <d
     t>
     < he=/feig/{feigi}"
      a rf"ofrns{ofrn.d}
        dt-gso=!feigeiig>{feignm}<a
         aan-hw"ofrn.dtn"{ofrn.ae}/>

    <nu dt-gso=ofrn.dtn"
     ipt aan-hw"feigeiig
        tp=tx"dt-gmdl"feignm"rqie/
         ye"et aan-oe=ofrn.ae eurd>
   <t>
    /d




              show(value) ⊕ show(input)
ngShow + ngResource
Problems
Verbose
Soaking wet (non-DRY)
Not easily reused
Next steps for inline edit
Figure out how to turn this in to a reusable component
Accidental success
          ↓
Angular empowerment
Changelog + audit inspector
          Strong audit trail
          Data integrity
          audited gem
Who, what, when, where, why, how

casOfrn <AtvRcr:Bs
ls feig  cieeod:ae
 adtd
  uie

 #..
   .
ed
n




Adtd:dpes:cieeod:ui <AtvRcr:Bs {
 uie:Aatr:AtvRcr:Adt     cieeod:ae
           :d= :nee,
           i > itgr
     :uial_d= :nee,
      adtbei > itgr
    :uial_ye= :tig
    adtbetp > srn,
    :soitdi = :nee,
     ascae_d > itgr
   :soitdtp = :tig
    ascae_ye > srn,
        :sri = :nee,
        ue_d > itgr
       :srtp = :tig
       ue_ye > srn,
       :srae= :tig
        uenm > srn,
        :cin= :tig
         ato > srn,
   :uie_hne = :et
    adtdcags > tx, #< ZM df
                     - OG if
        :eso = :nee,
        vrin > itgr
        :omn = :tig
        cmet > srn,
    :eoeades= :tig
    rmt_drs > srn,
      :rae_t= :aeie
       cetda > dttm
}
END / FIN / ‫סוף‬
   Thanks to Google
  Thanks to WeWork
    Thanks to you

Contenu connexe

Tendances

Useful javascript
Useful javascriptUseful javascript
Useful javascriptLei Kang
 
A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1jsalonen Salonen
 
Paperjs presentation
Paperjs presentationPaperjs presentation
Paperjs presentationsharp-blade
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the WorldPebble Technology
 
Shkrubbel for Open Web Camp 3
Shkrubbel for Open Web Camp 3Shkrubbel for Open Web Camp 3
Shkrubbel for Open Web Camp 3kitthod
 
Intro to Systems Orchestration with MCollective
Intro to Systems Orchestration with MCollectiveIntro to Systems Orchestration with MCollective
Intro to Systems Orchestration with MCollectivePuppet
 
Use of django at jolt online v3
Use of django at jolt online v3Use of django at jolt online v3
Use of django at jolt online v3Jaime Buelta
 
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Puppet
 
Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTatsuhiko Miyagawa
 
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19MoscowJS
 
Web Tech & Architecture
Web Tech & ArchitectureWeb Tech & Architecture
Web Tech & Architecturedynamis
 
Nomethoderror talk
Nomethoderror talkNomethoderror talk
Nomethoderror talkJan Berdajs
 
Program(Output)
Program(Output)Program(Output)
Program(Output)princy75
 
Go Containers
Go ContainersGo Containers
Go Containersjgrahamc
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X ServerYasuhiro Asaka
 
Voldemort collections library
Voldemort collections libraryVoldemort collections library
Voldemort collections libraryJason Ko
 

Tendances (20)

Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1A Backbone.js Tutorial for the Impatient - Part 1
A Backbone.js Tutorial for the Impatient - Part 1
 
Paperjs presentation
Paperjs presentationPaperjs presentation
Paperjs presentation
 
Connecting Pebble to the World
Connecting Pebble to the WorldConnecting Pebble to the World
Connecting Pebble to the World
 
Shkrubbel for Open Web Camp 3
Shkrubbel for Open Web Camp 3Shkrubbel for Open Web Camp 3
Shkrubbel for Open Web Camp 3
 
Intro to Systems Orchestration with MCollective
Intro to Systems Orchestration with MCollectiveIntro to Systems Orchestration with MCollective
Intro to Systems Orchestration with MCollective
 
Use of django at jolt online v3
Use of django at jolt online v3Use of django at jolt online v3
Use of django at jolt online v3
 
Czzawk
CzzawkCzzawk
Czzawk
 
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
Absolute Beginners Guide to Puppet Through Types - PuppetConf 2014
 
Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncher
 
WebXR if X = how?
WebXR if X = how?WebXR if X = how?
WebXR if X = how?
 
Gkm referral program
Gkm referral programGkm referral program
Gkm referral program
 
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
 
Web Tech & Architecture
Web Tech & ArchitectureWeb Tech & Architecture
Web Tech & Architecture
 
Nomethoderror talk
Nomethoderror talkNomethoderror talk
Nomethoderror talk
 
Program(Output)
Program(Output)Program(Output)
Program(Output)
 
Couchdb
CouchdbCouchdb
Couchdb
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Voldemort collections library
Voldemort collections libraryVoldemort collections library
Voldemort collections library
 

En vedette

WeWork - NOAH16 Berlin
WeWork - NOAH16 BerlinWeWork - NOAH16 Berlin
WeWork - NOAH16 BerlinNOAH Advisors
 
We work south bank
We work south bankWe work south bank
We work south bankToby Allen
 
WeWork Lunch & Learn
WeWork Lunch & LearnWeWork Lunch & Learn
WeWork Lunch & LearnMailjet
 
160518 테헤란로 커피클럽 WeWork
160518 테헤란로 커피클럽 WeWork160518 테헤란로 커피클럽 WeWork
160518 테헤란로 커피클럽 WeWorkStartupAlliance
 
Guide pour créer un espace de coworking
Guide pour créer un espace de coworkingGuide pour créer un espace de coworking
Guide pour créer un espace de coworkingLa French Team
 
Scaling CTO / On Freund
Scaling CTO / On Freund   Scaling CTO / On Freund
Scaling CTO / On Freund geektimecoil
 
WeWork Labs Seminar: Raising Money by Convertible Debt
WeWork Labs Seminar: Raising Money by Convertible DebtWeWork Labs Seminar: Raising Money by Convertible Debt
WeWork Labs Seminar: Raising Money by Convertible DebtWilmerHale
 
Stories and Experience (TEDx Newcastle)
Stories and Experience (TEDx Newcastle)Stories and Experience (TEDx Newcastle)
Stories and Experience (TEDx Newcastle)Mike Stenhouse
 
Visual Design Thinking - Prague 2013 - WebExpo
Visual Design Thinking - Prague 2013 - WebExpoVisual Design Thinking - Prague 2013 - WebExpo
Visual Design Thinking - Prague 2013 - WebExpovisualdesignthinking
 
Conversation 2.0
Conversation 2.0Conversation 2.0
Conversation 2.0frog
 
Pregi e difetti dei principali CMS Open Source
Pregi e difetti dei principali CMS Open SourcePregi e difetti dei principali CMS Open Source
Pregi e difetti dei principali CMS Open Sourcenois3
 
Designing interactive Experience
Designing interactive ExperienceDesigning interactive Experience
Designing interactive ExperienceThomas Gläser
 

En vedette (20)

WeWork - NOAH16 Berlin
WeWork - NOAH16 BerlinWeWork - NOAH16 Berlin
WeWork - NOAH16 Berlin
 
We work south bank
We work south bankWe work south bank
We work south bank
 
The joy of sharing_WeWork
The joy of sharing_WeWorkThe joy of sharing_WeWork
The joy of sharing_WeWork
 
WeWork Lunch & Learn
WeWork Lunch & LearnWeWork Lunch & Learn
WeWork Lunch & Learn
 
160518 테헤란로 커피클럽 WeWork
160518 테헤란로 커피클럽 WeWork160518 테헤란로 커피클럽 WeWork
160518 테헤란로 커피클럽 WeWork
 
Guide pour créer un espace de coworking
Guide pour créer un espace de coworkingGuide pour créer un espace de coworking
Guide pour créer un espace de coworking
 
Insidesaleswiz-info
Insidesaleswiz-infoInsidesaleswiz-info
Insidesaleswiz-info
 
Scaling CTO / On Freund
Scaling CTO / On Freund   Scaling CTO / On Freund
Scaling CTO / On Freund
 
Labs Overview
Labs OverviewLabs Overview
Labs Overview
 
WeWork Labs Seminar: Raising Money by Convertible Debt
WeWork Labs Seminar: Raising Money by Convertible DebtWeWork Labs Seminar: Raising Money by Convertible Debt
WeWork Labs Seminar: Raising Money by Convertible Debt
 
We work pitch deck
We work pitch deckWe work pitch deck
We work pitch deck
 
D&T Association Summer School 2015
D&T Association Summer School 2015D&T Association Summer School 2015
D&T Association Summer School 2015
 
Stories and Experience (TEDx Newcastle)
Stories and Experience (TEDx Newcastle)Stories and Experience (TEDx Newcastle)
Stories and Experience (TEDx Newcastle)
 
Scrppy
ScrppyScrppy
Scrppy
 
Visual Design Thinking - Prague 2013 - WebExpo
Visual Design Thinking - Prague 2013 - WebExpoVisual Design Thinking - Prague 2013 - WebExpo
Visual Design Thinking - Prague 2013 - WebExpo
 
Twenty Plus
Twenty PlusTwenty Plus
Twenty Plus
 
Conversation 2.0
Conversation 2.0Conversation 2.0
Conversation 2.0
 
Pregi e difetti dei principali CMS Open Source
Pregi e difetti dei principali CMS Open SourcePregi e difetti dei principali CMS Open Source
Pregi e difetti dei principali CMS Open Source
 
HungryMind
HungryMindHungryMind
HungryMind
 
Designing interactive Experience
Designing interactive ExperienceDesigning interactive Experience
Designing interactive Experience
 

Similaire à Angular.js + Rails at WeWork or: The Accidental Feature

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSPat Cito
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsHeroku
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleAri Lerner
 
Learn Frontend Testing
Learn Frontend TestingLearn Frontend Testing
Learn Frontend TestingRyan Roemer
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony componentsMichael Peacock
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaAlexander Gyoshev
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJSAdam Štipák
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Odoo
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeAndrea Cardinale
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidSomenath Mukhopadhyay
 
Improving the performance of Odoo deployments
Improving the performance of Odoo deploymentsImproving the performance of Odoo deployments
Improving the performance of Odoo deploymentsOdoo
 
Architecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko GargentaArchitecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko Gargentajaxconf
 
Beyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeBeyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeWim Godden
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stackEric Ahn
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaTony Fabeen
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 

Similaire à Angular.js + Rails at WeWork or: The Accidental Feature (20)

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Starting out with Ember.js
Starting out with Ember.jsStarting out with Ember.js
Starting out with Ember.js
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
 
Learn Frontend Testing
Learn Frontend TestingLearn Frontend Testing
Learn Frontend Testing
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony components
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and java
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJS
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtime
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
 
Improving the performance of Odoo deployments
Improving the performance of Odoo deploymentsImproving the performance of Odoo deployments
Improving the performance of Odoo deployments
 
Architecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko GargentaArchitecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko Gargenta
 
Beyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeBeyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the code
 
Elk stack
Elk stackElk stack
Elk stack
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with Lua
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Groovy
GroovyGroovy
Groovy
 

Dernier

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Dernier (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

Angular.js + Rails at WeWork or: The Accidental Feature

  • 1. Angular.js + Rails = ♥ or: The Accidental Feature By Jonathan E. Magen / @yonkeltron Sr. Software Engineer, WeWork
  • 2. Identify yourself Jonathan E. Magen / yonkeltron errywhere else Practitioner of the Computer Sciences Research @ The Evergreen State College Advanced OS Lab WeWork engineer
  • 3. About WeWork “ We want to change the way people work. ” - Adam Neumann, WeWork Co-Founder “ Design to make people happy. ” - Miguel McKelvey, WeWork Co-Founder 7 Buildings 3 Cities 4000+ Members Services for the community
  • 4. Computing at WeWork Tech stack Rails Heroku PostgreSQL Agile!
  • 6.
  • 7. Spaceman: WeWork backoffice hawtness Space management Billing Reservations Accounting system integration
  • 8. Things we've built with Angular Audit trail + changelog inspector using audited gem Infinite scroll using will_paginate gem Inline edit Lots of stuff using ngResource
  • 10. Free RESTful JSON endpoints casOfrnsotolr<Apiainotolr ls feigCnrle plctoCnrle dfidx e ne @feig =Ofrn.aeprm[pg] ofrns feigpg(aas:ae) rsodt d |omt epn_o o fra| fra.tl#idxhm.r omthm ne.tleb fra.sn{rne jo:@feig,ro:fle} omtjo edr sn ofrns ot as ed n ed n #ohratos. te cin.. ed n ActiveRecord → JSON → HTTP
  • 11. ngResource aglrmdl(ofrnsevc' [nRsuc') nua.oue'feigSrie, 'geore]. fcoy'feig,fnto ofrn(rsuc){ atr(Ofrn' ucin feig$eore rtr $eore'ofrns:d,{d 'i',{ eun rsuc(/feig/i' i: @d} cet:{mto:'OT } rae ehd PS' , idx {mto:'E' iAry tu } ne: ehd GT, sra: re , so: {mto:'E'} hw ehd GT , udt:{mto:'U'} pae ehd PT }; ) }; ) Rails → JSON/HTTP → ngResource
  • 12. Rails renders Angular template HTML Times you might want to do this: Permissions: only rendering parts of a template Dynamically populate form s l c options eet Internationalization!
  • 13. Permission-driven rendering <=i cretue.a_oe :uio % % f urn_srhsrl? adtr > <i dt-gap"pcmn> dv aan-p=saea" <i dt-uis"e" dv aaadt=yp dt-uial-ye"% Ofrn.os%" aaadtbetp=<= feigt_ > dt-uial-d"% @feigi %"<dv aaadtbei=<= ofrn.d >>/i> <dv /i> < ed% % n > Only render the audit inspector directive iff the current user has the authorization to access audit data
  • 14. i18n API column headers <al cas"al tbesrpd dt-gap"pcmn> tbe ls=tbe al-tie" aan-p=saea" <ha> ted <h<=Ofrn.ua_trbt_ae:ae %<t> t>% feighmnatiuenm(nm) >/h <h<=Ofrn.ua_trbt_ae:aeoiain %<t> t>% feighmnatiuenm(ctgrzto) >/h <h<=Ofrn.ua_trbt_ae:rc)%<t> t>% feighmnatiuenm(pie >/h <h<t> t>/h <h<t> t>/h <ted /ha> t e drendered by Rails includes localized column headers. This ha lets Angular render the t o ycontaining actual data. bd
  • 15. One minor snag cni.sesj_opesr=Srces:ayopesrnwd ofgast.scmrso pokt:LzCmrso.e o Ulfe.e(age fle #dntoltrt nms giirnwmnl: as) o' bieae ae ed n config/environments/production.rb
  • 16. Angular on Rails Rails gives you RESTful JSON endpoints for free ngResource lets you consume them for free Let Rails help you render templates
  • 18. It started with a spike The requirement: Allow a user to quickly inline edit inventory on the index page. *Actual Spaceman wireframe
  • 19. The search for inline edit Oh God, please make it stop
  • 20. Yeah, I know there were easier ways to do this Gorillions of jQuery plugins Far fewer Angular-friendly options Google Groups StackOverflow We knew we'd need Angular.js but wanted to ease our way in gradually
  • 21. A subtle rejection of ngGrid Reimplementing t b ein terms of d v al i Does way more than what we needed Sub project of Angular UI TBH: Angular.js could really use widgets Web Components?
  • 23. Offerings controller saea.otolr'feig' fnto (soe sacPrmevc,Ofrn){ pcmncnrle(ofrns, ucin $cp, erhaaSrie feig cnoelg'feig Cnolr) osl.o(Ofrns otle'; $cp.feig =Ofrn.ur(;/ nRsuc ZM! soeofrns feigqey) / geore OG $cp.dtnTgl =fnto eiigogeofrn){ soeeiigoge ucin dtnTgl(feig i (feigeiig { f ofrn.dtn) Ofrn.paeofrn) feigudt(feig; ofrn.dtn =fle feigeiig as; }es { le ofrn.dtn =tu; feigeiig re } }; }; )
  • 24. The show/hide model for cells in the table body <bd dt-gcnrle=ofrns> toy aan-otolr"feig" <rdt-grpa=ofrn i ofrns> t aan-eet"feig n feig" <d t> < he=/feig/{feigi}" a rf"ofrns{ofrn.d} dt-gso=!feigeiig>{feignm}<a aan-hw"ofrn.dtn"{ofrn.ae}/> <nu dt-gso=ofrn.dtn" ipt aan-hw"feigeiig tp=tx"dt-gmdl"feignm"rqie/ ye"et aan-oe=ofrn.ae eurd> <t> /d show(value) ⊕ show(input)
  • 27. Next steps for inline edit Figure out how to turn this in to a reusable component
  • 28. Accidental success ↓ Angular empowerment
  • 29. Changelog + audit inspector Strong audit trail Data integrity audited gem
  • 30. Who, what, when, where, why, how casOfrn <AtvRcr:Bs ls feig cieeod:ae adtd uie #.. . ed n Adtd:dpes:cieeod:ui <AtvRcr:Bs { uie:Aatr:AtvRcr:Adt cieeod:ae :d= :nee, i > itgr :uial_d= :nee, adtbei > itgr :uial_ye= :tig adtbetp > srn, :soitdi = :nee, ascae_d > itgr :soitdtp = :tig ascae_ye > srn, :sri = :nee, ue_d > itgr :srtp = :tig ue_ye > srn, :srae= :tig uenm > srn, :cin= :tig ato > srn, :uie_hne = :et adtdcags > tx, #< ZM df - OG if :eso = :nee, vrin > itgr :omn = :tig cmet > srn, :eoeades= :tig rmt_drs > srn, :rae_t= :aeie cetda > dttm }
  • 31.
  • 32.
  • 33.
  • 34. END / FIN / ‫סוף‬ Thanks to Google Thanks to WeWork Thanks to you