After developing conventions for working with Backbone/Marionette, I wrote my own rails generators and application template. These remove a lot of unnecessary files, and sets up sensible defaults for working with Backbone/Marionette projects.
The marionette-template.rb
is an application template used when creating a new rails application. To use this application template, in the terminal type:
rails new APPNAME -m https://raw.github.com/brian-mann/rails-generators/master/marionette-template.rb
- Removes default
app/assets/images/rails.png
image - Removes default
public/index.html
file - Renames
README.rdoc
toREADME.md
- chmod's log directory to 0777
- TODO: add db directory
- Sets default route to:
application#index
- Creates
app/views/application
directory - Creates
app/views/application/index.html.erb
file
- Creates
app/assets/stylesheets/apps
directory - Creates
app/assets/stylesheets/app/_base.css.scss
file - Renames
app/assets/stylesheets/application.css
toapplication.css.scss
- Removes
require self
andrequire tree .
fromapplication.css.scss
file - Imports
twitter/bootstrap
andapps/_base
SCSS files
- Removes
jquery_ujs
andrequire_tree .
fromapp/assets/javascripts/application.js
file
- thin
- rabl
- oj
- gon
- js-routes
- eco
- compass-rails
- bootstrap-sass-rails
- Document additional template actions
- Document entire use of all the generators