Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/etewiah/sharing_handlebars_templates_in_backbone
Adaptation of railscasts 325 and 295 to share handlebars templates in backbone
https://github.com/etewiah/sharing_handlebars_templates_in_backbone
Last synced: 16 days ago
JSON representation
Adaptation of railscasts 325 and 295 to share handlebars templates in backbone
- Host: GitHub
- URL: https://github.com/etewiah/sharing_handlebars_templates_in_backbone
- Owner: etewiah
- Created: 2012-07-12T17:13:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-12T18:50:54.000Z (over 12 years ago)
- Last Synced: 2024-12-20T07:41:50.651Z (20 days ago)
- Language: Ruby
- Size: 125 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
This is based on railscast 325:
http://railscasts.com/episodes/325-backbone-on-rails-part-2
I have gone on to replace the eco templates with handlebars templates by using the handlebars_assets gem.
I have then implemented the technique for sharing templates between the server and the client presented in railscasts 295.
I adapted the code used in that railscast to make it work with handlebars instead of moustach by borrowing code from this gem:
https://github.com/railsware/sht_railsBrowsing to "/server_rendering" will now display html generated on the server side from ALMOST the same handlebar template as the client would use.
At this point I face a problem:
I cannot figure out how to implement the method used by backbone of recursing through each item in the collection and applying a template to it.
Any ideas on how to do this so I can use EXACTLY the same template on both the server and client would be much appreciated.Requires Ruby 1.9.2 or later to run.