I've changed the following files to have a customized scaffold generator which saves a ton of work in the development process. The deps
directory is in .gitignore
so that's not a valid way to share those changes with other developers in the team. What is a good way to customize those default templates so that everybody in the development team can use them?
$ tree deps/phoenix/priv/templates/phoenix.gen.html
deps/phoenix/priv/templates/phoenix.gen.html
├── controller.ex
├── controller_test.exs
├── edit.html.eex
├── form.html.eex
├── index.html.eex
├── new.html.eex
├── show.html.eex
└── view.ex
The mix task look at first to the priv
folder in your project if there nothing exists the default of phoenix dep will used.
Make a copy of deps/phoenix/priv/templates/phoenix.gen.html
to priv/templates/phoenix.gen.html
and it will work.
I'm not sure if there some documentation about this function, but you can look at deps/phoenix/lib/mix/tasks/phoenix.gen.html.ex
you see at the bottom the function paths
. That define the lookup to ./
and after them phoenix dep.
defp paths do
[".", :phoenix]
end
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With