meleyal / backbone-on-rails

A simple gem for using Backbone.js with Rails.
MIT License
810 stars 126 forks source link

Optional app name and path #70

Closed spodlecki closed 9 years ago

spodlecki commented 9 years ago

Add support for dynamic Backbone application names, sub directories, and .hbs templates.

Why? The naming conventions are excellent and so are the generators, however, it causes a problem when you need multiple Backbone Apps in a single project. This happens when you have a public design and a CMS design

Generator options added:

# Custom Appname
rails generate backbone:install --app=CustomApp

# Place code within a sub directory structure
rails generate backbone:install --dir=custom_app

# 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=SHT

Tests added & passing

I did not bump versions -- is it possible we can bump version and get this on rubygems.org instead of having a git repo?

(edit: update generator names)

meleyal commented 9 years ago

Thanks, this looks great. I made some comments inline.

spodlecki commented 9 years ago

Absolutely. I'll send another commit in a few hours

spodlecki commented 9 years ago

All set. I did leave the 2 documentations in there though because it is showing that both generators carry this option

spodlecki commented 9 years ago

@meleyal all set

meleyal commented 9 years ago

Released 1.2.0.0: https://rubygems.org/gems/backbone-on-rails