Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meleyal/backbone-on-rails
A simple gem for using Backbone.js with Rails.
https://github.com/meleyal/backbone-on-rails
Last synced: 18 days ago
JSON representation
A simple gem for using Backbone.js with Rails.
- Host: GitHub
- URL: https://github.com/meleyal/backbone-on-rails
- Owner: meleyal
- License: mit
- Archived: true
- Created: 2011-11-04T16:28:56.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-23T14:07:48.000Z (almost 9 years ago)
- Last Synced: 2024-05-11T20:02:19.948Z (6 months ago)
- Language: Ruby
- Homepage:
- Size: 673 KB
- Stars: 809
- Watchers: 31
- Forks: 127
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
Backbone on Rails
=================A simple gem for using Backbone.js with Rails.
http://git.io/backbone-on-rails
Features
--------* Vendors the latest Backbone.js + Underscore.js in the asset pipeline
* Provides an install generator to create a skeleton directory
structure and manifest* Provides a scaffold generator to create files and boilerplate
* Uses the naming conventions from
thoughtbot's [Backbone.js on Rails](http://bit.ly/pLsmzr)* Generates CoffeeScript (default) or JavaScript
Usage
-----gem 'backbone-on-rails'
bundle install
rails generate backbone:install
rails generate backbone:scaffold NAME
*Note: Remember to restart the server after installing*
See also:
* http://railscasts.com/episodes/323-backbone-on-rails-part-1
* http://railscasts.com/episodes/325-backbone-on-rails-part-2Output
------Example output from backbone:scaffold planet
app/assets/
├── javascripts
│ ├── application.js
│ ├── space_app.js.coffee
│ ├── collections
│ │ └── planets.js.coffee
│ ├── models
│ │ └── planet.js.coffee
│ ├── routers
│ │ └── planets_router.js.coffee
│ └── views
│ └── planets
│ └── planets_index.js.coffee
└── templates
└── planets
└── index.jst.ecoTricks
------# Custom manifest
rails generate backbone:install --manifest index.js# Generate JavaScript
rails generate backbone:install --javascript# Custom Appname
rails generate backbone:install --app=CustomApp# Place code within a sub directory structure
rails generate backbone:install --dir=custom_app# Remove generated files
rails destroy backbone:scaffold planet# Create a custom app name
rails generate backbone:scaffold planet -a=CustomApp# Generate scaffold in sub directory of assets/javascripts & assets/templates
rails generate backbone:scaffold planet -d=custom_app# Use Handlebars File instead of JST
rails generate backbone:scaffold planet --template=hbs# Use SHT instead of JST as template namespace
rails generate backbone:scaffold planet --template_namespace=SHTAlternatives
------------For other features check out:
* https://github.com/codebrew/backbone-rails
* https://github.com/aflatter/backbone-rails