Ruby on Rails Thursday, November 6, 2014

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?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/15ec1013-a52d-4abd-8814-90f541b84871%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment