Rails Application Templates
How do you start a new Rails project? #
As the very first guide we do like this:
rails new blog -d postgresql
After that, you add some essentials gems and configuration, init Devise, add user controller…
- Devise: for authentication.
- Fiago: manage env variable.
- Replace Minitest by RSpec.
And then a new project comes, will you do the same? I think the answer is
So as Rails philosophy: “DRY” and “Convention Over Configuration”.
Rails provided us a better way to create new projects, same command as above and also use
rails new blog -d postgresql -m template.rb
template.rb can be an URL. For example:
template.rb will automate init new project for us.