Frequently I find myself creating basic rails apps to demonstrate a new feature, or prototype something for a spike
test. Every time I created an app, I would run rails new -T
, then add RSpec, Cucumber, Haml, possibly Bootstrap, etc.
After the 10th app in a month, I decided that there must be an easier way. Then I saw this post: http://everydayrails.com/2011/02/28/rails-3-application-templates.html
I started reading up on generators and application templates, then I thought I’d write my own, to see how it works. I pushed my template to GitHub.
Currently the template:
Haml
app/controllers/HomeController
and adds an index
actionapp/views/home/index.html.haml
root to: 'home#index'
to config/routes.rb
During the creation of your app, the template will ask whether or not you want to use these features/gems:
RSpec
Cucumber
twitter-bootstrap-rails
(with less), using therubyracer
(will fix later)
/app/views/layouts/application.html.erb
/app/views/layouts/application.html.haml
.gitignore
with common rails exclusionsgit init and git add '.'
git commit -a -m "Initial commit."
Check it out and let me know what you think!