When creating a mountable Rails 3.1 engine using
rails plugin new my_engine --mountable
it creates the engine at MyEngine::Engine < Rails::Engine
Is there a way to generate it like the jQuery::Rails engine (Jquery::Rails::Engine), or do I have to do it manually?
I tried these, and of course it didn’t work.
rails plugin new "my_module/my_engine" --mountable
rails plugin new "my_module::my_engine" --mountable
I took a peek in the rails source, and you won’t like the answer. Plugin generation seems to make the assumption that your engine name isn’t nested, like here.
If you really insist on not doing this by hand, you could try to hack your way through the generator or use a PluginBuilder with the
-boption of therails plugin newcommand. It doesn’t look documented though, a quick search on Google didn’t reveal any info, but I may have overlooked something.Hope this helps.