I am looking to not only customise my erb scaffold templates but also to add new templates.
In ScaffoldGenerator < Erb::Generators::Base
I can see there there is a way to provide additional templates in %w(index edit show new _form)
.
So I have created a custom erb generator and templates directory in my application in lib/generators/erb/scaffold/
.
However when I run rails g scaffold Something
, my custom generator is not picked up by via scaffold_controller
. Does this mean I need to provide a custom scaffold
generator to use a custom scaffold_controller
generator just so it can then use my erb
generator?
I can also see the scaffold argument:
ScaffoldController options:
-e, [--template-engine=NAME] # Template engine to be invoked
# Default: erb
Am I able to provide my erb generator as the template engine to be used?
(Using Rails 4)