Scaffold invoking Custom Generator

14 views
Skip to first unread message

Henrique Vilela

unread,
Nov 6, 2014, 5:05:57 PM11/6/14
to rubyonra...@googlegroups.com
Hi Guys,

I created a custom generator and I would like hook it to the scaffold generator, so whenever the scaffold generator is called, my generator is also called.

To achieve that i did this:

config.generators do |g|
  g.helper :my_custom
end

It works, but I have to concerns:

First, I had to replace one generator (helper). Is possible to add a new generator to the scaffold call, instead of replace one?

Second, I know that some gems like RSpec and Haml are able to replace generators (test_framework and templates, respectively) without change the config/application.rb, how is that possible?
Reply all
Reply to author
Forward
0 new messages