Git Product home page Git Product logo

backbone-on-rails's Introduction

B a c k b o n e   o n   R a i l s

}=}=}=}=}=}=}=}=}=}=}=}=}=}=}=}=}


  A simple gem for using Backbone.js with Rails (>= 3.1),
  based on thoughtbot's 'Backbone.js on 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[1] 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 planet

  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-2


Output
------

  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.js.coffee
  │   └── views
  │       └── planets
  │           └── index.js.coffee
  └── templates
      └── planets
          └── index.jst.eco


Tricks
------

  # Custom manifest
  rails generate backbone:install --manifest index.js

  # Namespaced install
  rails generate backbone:install --namespace solar_system

  # Namespaced scaffold
  rails generate backbone:scaffold solar_system/planet

  # Generate JavaScript
  rails generate backbone:install --javascript

  # Remove generated files
  rails destroy backbone:scaffold planet


Alternatives
------------

  For other features check out:

  * https://github.com/codebrew/backbone-rails
  * https://github.com/aflatter/backbone-rails


[1] http://bit.ly/vylNJO

backbone-on-rails's People

Contributors

derekprior avatar drale2k avatar jwarzech avatar kchung avatar meleyal avatar sascha avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.