Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing namespace folders when using generators inside an engine #28010

Closed
chancancode opened this issue Feb 14, 2017 · 2 comments
Closed

Missing namespace folders when using generators inside an engine #28010

chancancode opened this issue Feb 14, 2017 · 2 comments

Comments

@chancancode
Copy link
Member

Rails version: 5.0.1

Steps to reproduce

Generate an engine with >1 levels nested namespaces, e.g.

$ rails plugin new foo-bar --mountable
      create
      create  README.md
      create  Rakefile
      create  foo-bar.gemspec
      create  MIT-LICENSE
      create  .gitignore
      create  Gemfile
      create  app
      create  app/controllers/foo/bar/application_controller.rb
      create  app/helpers/foo/bar/application_helper.rb
      create  app/jobs/foo/bar/application_job.rb
      create  app/mailers/foo/bar/application_mailer.rb
      create  app/models/foo/bar/application_record.rb
      create  app/views/layouts/foo/bar/application.html.erb
      create  app/assets/images/foo/bar
      create  app/assets/images/foo/bar/.keep
      create  config/routes.rb
      create  lib/foo/bar.rb
      create  lib/tasks/foo/bar_tasks.rake
      create  lib/foo/bar/version.rb
      create  lib/foo/bar/engine.rb
      create  app/assets/config/foo_bar_manifest.js
      create  app/assets/stylesheets/foo/bar/application.css
      create  app/assets/javascripts/foo/bar/application.js
      create  bin/rails
      create  test/test_helper.rb
      create  test/foo/bar_test.rb
      append  Rakefile
      create  test/integration/navigation_test.rb
  vendor_app  test/dummy

That works as expected. However, when you run a generator inside this folder, it doesn't nest everything correctly, for example:

$ rails generate controller dashboard
      create  app/controllers/foo/dashboard_controller.rb
      invoke  erb
      create    app/views/foo/dashboard
      invoke  test_unit
      create    test/controllers/foo/dashboard_controller_test.rb
      invoke  helper
      create    app/helpers/foo/dashboard_helper.rb
      invoke    test_unit
      invoke  assets
      invoke    js
      create      app/assets/javascripts/foo/dashboard.js
      invoke    css
      create      app/assets/stylesheets/foo/dashboard.css

As you can see, it is supposed to generate app/controllers/foo/bar/dashboard_controller.rb, but it dropped the "bar" from the generated output.

@chancancode
Copy link
Member Author

@chancancode
Copy link
Member Author

Fixed by #27605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants