Rails & Backbone.js

13
+

Transcript of Rails & Backbone.js

Page 1: Rails & Backbone.js

+!

Page 2: Rails & Backbone.js

Hi I’m…!!Cheenu Madan Web development foralmost 15 years.Last 4 years on Ruby on RailsBuilt most of ClinchPadon Backbone.js!- 30k+ LOC Javascript!- 20k+ LOC Ruby!

!!!!

Page 3: Rails & Backbone.js

Built with Backbone.js  

Page 4: Rails & Backbone.js

Lets dive straight into code !

1.  git clone https://github.com/dthtvwls/rails-backbone-todos.git!

2.  bundle install!3.  rails s!4.  localhost:3000 !

Page 5: Rails & Backbone.js

                                             Mapping  

Models  &  Collec+ons    Views  &  Routers    Templates    

Models      Controllers    Views  

Page 6: Rails & Backbone.js

Advantages!!•  Separation of business logic & presentation

logic!

•  Add structure to applications!

•  Single page “desktop style” applications!

•  Technically less data sent over the wire!

Page 7: Rails & Backbone.js

Disadvantages!!!•  Harder to get started !

•  Code duplication !

•  SEO!

•  Dealing with non-RESTful backends !

Page 8: Rails & Backbone.js

Where you should use it !•  Applications where responsiveness is

important!

•  Large code bases!

•  API driven development !

•  Dynamic data that is frequently transformed!

Page 9: Rails & Backbone.js

Where you shouldn’t use it !•  Small projects - <1000 LOC!

•  Public facing websites e.g. news portals!

•  Applications which aren’t very interactive !

•  Mobile first applications that need to run on old phones (e.g. Android 2.2)!

Page 10: Rails & Backbone.js

Light  (11.5kb)    Building  blocks    Sinatra  like      

Heavy  (71kb)    Opinionated    Rails  like      

Heavy  (75kb)    Opinionated    Futuris+c        

Comparison!

Page 11: Rails & Backbone.js

Also written by the creator of Backbone.js, works great with Backbone.js!

More expressive than the!default underscore templates!

Will make your life much, much easier. Just ignore the huge size and include it!!

Stuff that plays nice!

Page 12: Rails & Backbone.js

Popular Backbone.js Extensions  

Page 13: Rails & Backbone.js