3 ms·
Could someone explain why something like eco makes sense in this context instead of just using rails (ERB) templates. Presumably you have to query the rails bac
by simonista 16y ago
Could someone explain why something like eco makes sense in this context instead of just using rails (ERB) templates. Presumably you have to query the rails backend at some point to get the data. Are the templates in coffeescript for cache-ability? Thanks!
- joshpeek 16y agoAll the eco templates are compiled and shipped along with the JS files. The server backend only sends JSON to the app. Its much smaller and faster to render, plus its cacheable on the client side. Its a huge win over RJS templates.
- simonista 16y agoThanks. Any downside?
- joshpeek 16y agoTheres some duplication between the server side (Ruby) and client side (JS) models.
- clojurerocks 16y agoWhy do they use js for the client side logic? Cant they use ruby? I know phonegap appelarator and rhomobile allow for this with rhomobile but all ruby. As im playing around with mobile applicaitons more im finding managing the javascript to be somewhat of a headache. So ive been wondering if theres ways to do with with other languages.
- nickw 16y agoThis is something I'd really like to see solved in client side frameworks like this. It seems to me that you could do something similar to how ActiveRecord queries the database for a model's attributes - but instead expose a JSON service that returns a models attributes and validations. But perhaps JS doesn't have the dynamic / meta-programming capabilities to make this happen like Ruby does.