I want the custom namespace "ops" since I have Admin as a model name so the Admin module is not possible for me. When I run rails generate administrate:routes --namespace ops I get Could not load generator "generators/administrate/routes/routes_generator". Error: uninitialized constant Op::ApplicationController (the controller is Ops::ApplicationController). It would be great if the "s" was not stripped from the namespace. Thanks!
You could try to disable the inflector rule with something like this:
# config/initializers/inflections.rb
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.uncountable %w{ ops }
end
I just hit this issue today - would this be a useful note to add to the docs?
Adding to the inflector is the right thing to do here (it's conventional Rails). I'd love to see a mention in the docs though, so someone can easily fix this in the future!
Ran into this today, changing the inflection makes no sense for us as the namespace corresponds to a module Things, not a module Thing. I found the following works as a workaround:
module Admin
module Things
class StuffsController < Admin::ApplicationController
def resource_class
::Things::Stuff
end
def dashboard_class
::Things::StuffDashboard
end
end
end
end
Most helpful comment
You could try to disable the inflector rule with something like this: