For the longest time PartialRenderer#partial_path has prefixed the prefix of the current controller when it is nested in a module. This hasn't been a problem (because nesting controllers wasn't that common) but with 3.1 striving for better engine support, this problem is now larger because all of your controllers for an engine will be nested and it makes doing <%= render @thing %> in your code (and anybody else's) extremely tedious and impossible without specifying the :partial to use.
https://github.com/rails/rails/blob/master/actionpack/lib/action_view/renderer/partial_renderer.rb#L150-159 Normally this function grabs the partial to use with model_name.partial_path which is great for default views (things/ _thing.html.erb) but as soon as you call it from a controller that is nested it ends up giving you a path like controller_namespace/things/ _thing.html.erb. I can see the advantage of that (if you want different partial for @thing in your admin namespace) but I think the disadvantage of being unable to reuse your partials is too big (especially with other code using your engine).
module Foo class Engine < Rails::Engine; isolate_namespace Foo; end class ApplicationController < ActionController::Base; end class Thing < ActiveRecord::Base; end end Foo::Thing.connection.create_table(:foo_things) Foo::ApplicationController.new.view_context._partial_renderer.send(:partial_path, Foo::Thing.new) => "foo/foo/things/thing"
I believe the solution should be to change the default behaviour or at least provide an option to stop rails from prefixing the partial_path.