SlideShare a Scribd company logo
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

More Related Content

What's hot

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 1
jsalonen 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 World
Pebble 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 MCollective
Puppet
 
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
Jaime 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 2014
Puppet
 
Tilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncherTilting Google Maps and MissileLauncher
Tilting Google Maps and MissileLauncher
Tatsuhiko Miyagawa
 
WebXR if X = how?
WebXR if X = how?WebXR if X = how?
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
MoscowJS
 
Web Tech & Architecture
Web Tech & ArchitectureWeb Tech & Architecture
Web Tech & Architecture
dynamis
 
Nomethoderror talk
Nomethoderror talkNomethoderror talk
Nomethoderror talkJan Berdajs
 
Program(Output)
Program(Output)Program(Output)
Program(Output)princy75
 
Couchdb
CouchdbCouchdb
Go Containers
Go ContainersGo Containers
Go Containers
jgrahamc
 
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 library
Jason Ko
 

What's hot (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
 

Viewers also liked

WeWork - NOAH16 Berlin
WeWork - NOAH16 BerlinWeWork - NOAH16 Berlin
WeWork - NOAH16 Berlin
NOAH Advisors
 
We work south bank
We work south bankWe work south bank
We work south bank
Toby Allen
 
The joy of sharing_WeWork
The joy of sharing_WeWorkThe joy of sharing_WeWork
The joy of sharing_WeWork
Green Initiatives 绿色倡议
 
WeWork Lunch & Learn
WeWork Lunch & LearnWeWork Lunch & Learn
WeWork Lunch & Learn
Mailjet
 
160518 테헤란로 커피클럽 WeWork
160518 테헤란로 커피클럽 WeWork160518 테헤란로 커피클럽 WeWork
160518 테헤란로 커피클럽 WeWork
StartupAlliance
 
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
La 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 Debt
WilmerHale
 
We work pitch deck
We work pitch deckWe work pitch deck
We work pitch deck
Saber Ben Hassen
 
D&T Association Summer School 2015
D&T Association Summer School 2015D&T Association Summer School 2015
D&T Association Summer School 2015
Steven Parkinson FRSA
 
Stories and Experience (TEDx Newcastle)
Stories and Experience (TEDx Newcastle)Stories and Experience (TEDx Newcastle)
Stories and Experience (TEDx Newcastle)
Mike Stenhouse
 
Scrppy
ScrppyScrppy
Scrppy
GoKart Labs
 
Visual Design Thinking - Prague 2013 - WebExpo
Visual Design Thinking - Prague 2013 - WebExpoVisual Design Thinking - Prague 2013 - WebExpo
Visual Design Thinking - Prague 2013 - WebExpo
visualdesignthinking
 
Twenty Plus
Twenty PlusTwenty Plus
Twenty Plus
GoKart Labs
 
Conversation 2.0
Conversation 2.0Conversation 2.0
Conversation 2.0
frog
 
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
nois3
 
HungryMind
HungryMindHungryMind
HungryMind
GoKart Labs
 
Designing interactive Experience
Designing interactive ExperienceDesigning interactive Experience
Designing interactive Experience
Thomas Gläser
 

Viewers also liked (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
 

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

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSPat Cito
 
Starting out with Ember.js
Starting out with Ember.jsStarting out with Ember.js
Starting out with Ember.js
Anirudh Shivanand
 
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
Heroku
 
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
Ari Lerner
 
Learn Frontend Testing
Learn Frontend TestingLearn Frontend Testing
Learn Frontend Testing
Ryan 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 java
Alexander Gyoshev
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJS
Adam Š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 Engine
Andy 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 realtime
Andrea 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 Android
Somenath Mukhopadhyay
 
Improving the performance of Odoo deployments
Improving the performance of Odoo deploymentsImproving the performance of Odoo deployments
Improving the performance of Odoo deployments
Odoo
 
Architecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko GargentaArchitecting Android Apps: Marko Gargenta
Architecting Android Apps: Marko Gargenta
jaxconf
 
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
Wim Godden
 
Elk stack
Elk stackElk stack
Elk stack
Jilles van Gurp
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
Eric 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
 
Groovy
GroovyGroovy
Groovy
Zen Urban
 

Similar to 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
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

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