meleyal / backbone-on-rails

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

Setting default templating extension and javascripts/coffeescript option from an initializer. #48

Closed matrushka closed 10 years ago

matrushka commented 11 years ago

While developing a project writing --javascript for each generator and renaming each template extension to hbs feels really heavy sometimes. Yet the current --javascript option is enough for many cases adding a config option which can be set in an initializer will speed things up a lot.

Tests are missing for the new features i have added because i don't know how to test options set in initializers. Yet the current tests ran without a failure in my case.

Options can be set in an initializer like below:

BackboneOnRails::Config.use_cofeescript = false
BackboneOnRails::Config.jst = "hbs"
matheustardivo commented 11 years ago

:+1:

meleyal commented 10 years ago

I'm happy to merge this if someone can add tests.