You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A hook to invoke the custom generator with scaffolding or with controller's generators
# lib/generators/rails/policy/hooks.rbrequire'rails/generators'require'rails/generators/rails/scaffold/scaffold_generator'require'rails/generators/rails/controller/controller_generator'Rails::Generators::ScaffoldGenerator.hook_for:policy,default: true,type: :boolean# invoke with scaffolding generatorsRails::Generators::ControllerGenerator.hook_for:policy,default: true,type: :boolean# invoke with the controllers' generator.
Thanks yall. I wrote a blogpost to cover what ended up working for me. I did end up needing the requires, but I wasn't using custom templates so not sure if it breaks that like you mentioned.
Thanks yall. I wrote a blogpost to cover what ended up working for me. I did end up needing the requires, but I wasn't using custom templates so not sure if it breaks that like you mentioned.
Adding a Custom Generator to Rails Scaffold