Whenever we begin a new rails project, we dedicate a part time preparing our application for the project.
Generally we have some Gems that we always use, some preferences and configurations that we should do every time when start a new application. The question here is: Why not automate this?
Well, considering these cases, I created a project to automate these things.
As Rails gives an option to use a template when creating a new application, this was the way.
After knowing what I wanted, I was looking for options to make the base of my code. After several searches I found the template from He:labs. I really liked the idea of how the code is written, so I fork the project and began to modify it as I wanted to do and according to our preferences.
I used the template on several projects, including Rails Rumble. We also use on StartupDEV's Rumble, that I participated with Caixa de Ideias guys. They liked the project so much, that adopted the default template in projects that are initiated by them.
The patterns, gems and preferences were acquired through various projects I participated at Engage.
Ok, how I use the template in my projects?
Clone the rails-template to your home directory or another of your choice.
git clone git://github.com/josemarluedke/rails-template.git ~/rails-template
To create the application with the template use the following command:
rails new app_name -m ~/rails-template/template.rb
How does this work?
The template will ask you to choose some preferences. The questions are the following:
The template has many hidden features that help make the application more prepared for the project.
Here are a few items:
- Cleanup your app - Remove unused files
- Database configurations - database.sample.yml
- Flash messages partial
- Header and Footer partial for layout
- Great .gitignore
- Great and useful gems (Check the Gemfile :D)
- Config the rails generators
- Devise views in slim and I18n
The template takes some preferences for the application.
Here are a few items:
The project is very nice, but has enough things to do and improve. If you want to contribute, you will be very welcome.