3 ms·
Can you not mix Rails with backbone.js and the like? I thought it was possible.
by robot 14y ago
Can you not mix Rails with backbone.js and the like? I thought it was possible.
- jschuur 14y agoNot only that, but there's a whole book on the subject (I'm not affiliated with it): https://workshops.thoughtbot.com/products/1-backbone-js-on-rails https://workshops.thoughtbot.com/products/1-backbone-js-on-r...
- taterbase 14y agoYou can, it just makes some of Rails' niceties unnecessary. Views and "Controllers" are handled up front by backbone. You just need routing and models from Rails.
- stiller 14y agoBackbone controllers don't replace Rails controllers. You will still need both for a functioning app. Rails' views are largely replaced by client-side templates in a single-page app, although you can use the asset pipeline to compile and serve these.
- irahul 14y ago> You can, it just makes some of Rails' niceties unnecessary. Views and "Controllers" are handled up front by backbone. You just need routing and models from Rails. backbone.js sends CRUD requests to rails app which are handled by the controller, and the main page is rails view.
- nahname 14y agoBackbone is built with that intension in mind. It is quite opinionated in that regard as well. Look at how Backbone collections work to understand why.
- jashkenas 14y agoBackbone.js was originally developed as part of the front-end of a Rails app: DocumentCloud.org ... that said, it's being used with a vast variety of different backends these days: http://backbonejs.org/#examples http://backbonejs.org/#examples