Fix generator command for nested (namespaced) rails engine (take 2) #27605
Conversation
Rewrite #27550 085546d was reverted (b6ffb5e) because it change the return of `namespaced_path` from String to Array. ---------------- If we create nested (namespaced) rails engine such like bukkits-admin, `bin/rails g scaffold User name:string age:integer` will create `bukkits-admin/app/controllers/bukkits/users_controller.rb` but it should create `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`. In #6643, we changed `namespaced_path` as root path because we supposed application_controller is always in root but nested rails engine's application_controller will not.
r? @kaspth (@rails-bot has picked a reviewer for you, use r? to override) |
@mtsmfm thank you!! |
NTS: should be backported to 5-0-stable |
This was referenced Feb 15, 2017
wycats
pushed a commit
that referenced
this pull request
Feb 24, 2017
…d-rails-engine-take-2 Fix generator command for nested (namespaced) rails engine (take 2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Rewrite #27550
085546d was reverted (b6ffb5e) because it change the return of
namespaced_path
from String to Array.If we create nested (namespaced) rails engine such like bukkits-admin,
bin/rails g scaffold User name:string age:integer
will create
bukkits-admin/app/controllers/bukkits/users_controller.rb
but it should create
bukkits-admin/app/controllers/bukkits/admin/users_controller.rb
.In #6643, we changed
namespaced_path
as root pathbecause we supposed application_controller is always in root
but nested rails engine's application_controller will not.