FIX: fixes plugin generator with zeitwerk (#8220)

FIX: fixes plugin generator with zeitwerk (#8220)

diff --git a/lib/generators/plugin/plugin_generator.rb b/lib/generators/plugin/plugin_generator.rb
index 9eb71d0567..6f7a2b2011 100644
--- a/lib/generators/plugin/plugin_generator.rb
+++ b/lib/generators/plugin/plugin_generator.rb
@@ -29,7 +29,7 @@ class PluginGenerator < Rails::Generators::NamedBase
   end
 
   def controller_file
-    template 'plugin_controller.rb.erb', File.join('plugins', dasherized_name, "app/controllers/#{dasherized_name}/#{underscored_name}_controller.rb")
+    template 'plugin_controller.rb.erb', File.join('plugins', dasherized_name, "app/controllers/#{underscored_name}/#{underscored_name}_controller.rb")
     template 'controller.rb.erb', File.join('plugins', dasherized_name, "app/controllers/#{underscored_name}/actions_controller.rb")
     template 'controller_spec.rb.erb', File.join('plugins', dasherized_name, "spec/requests/actions_controller_spec.rb")
   end
diff --git a/lib/generators/plugin/templates/routes.rb.erb b/lib/generators/plugin/templates/routes.rb.erb
index 5a4d6c6d9a..4f31f596ce 100644
--- a/lib/generators/plugin/templates/routes.rb.erb
+++ b/lib/generators/plugin/templates/routes.rb.erb
@@ -1,7 +1,7 @@
 require_dependency "<%= underscored_name %>_constraint"
 
 <%= classified_name %>::Engine.routes.draw do
-  get "/" => "<%= dasherized_name %>#index", constraints: <%= classified_name %>Constraint.new
+  get "/" => "<%= underscored_name %>#index", constraints: <%= classified_name %>Constraint.new
   get "/actions" => "actions#index", constraints: <%= classified_name %>Constraint.new
   get "/actions/:id" => "actions#show", constraints: <%= classified_name %>Constraint.new
 end

GitHub sha: 8f51445e