0
案例生成:如何讓我深深的命名空間發電機工作
module MyPlugin
module Generators
module SomeNamespace
class ThingsGenerator < Rails::Generators::Base
# stuff
end
end
end
end
正如預期的那樣rails g
輸出這樣的:
MyPlugin:
my_plugin:some_namespace:things
所以應該工作,對不對?錯誤:
> rails g my_plugin:some_namespace:things
Could not find generator my_plugin:some_namespace:things
那麼,發生了什麼事? Rails可以看到發生器,它也可以通過Rails::Generators::TestCase
完全測試。
有什麼想法?我總是可以做一個my_plugin:some_namespace_things
,但它看起來很醜。