Last Updated: February 25, 2016
·
191
· _joliv

Checking available Rails generators programatically

In a recent debug session, I needed to know which generators were available at a certain point in time.

There's an undocumented way to see them, up to Rails 4.1.7 (I don't know starting from which version) there's Rails::Generators.help (don't forget to require 'rails/generators'!).

In what's today the master branch, there's a new Rails::Generators.print_generators that prints all generators, so that'll probably be available in upcoming Rails versions.