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

Fix generator command for nested (namespaced) rails engine (take 2) #27605

Conversation

@mtsmfm
Copy link
Contributor

@mtsmfm mtsmfm commented Jan 7, 2017

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.

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.
@rails-bot
Copy link

@rails-bot rails-bot commented Jan 7, 2017

r? @kaspth

(@rails-bot has picked a reviewer for you, use r? to override)

@chancancode chancancode merged commit 6e5e8ba into rails:master Feb 15, 2017
2 checks passed
2 checks passed
codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@chancancode
Copy link
Member

@chancancode chancancode commented Feb 15, 2017

@mtsmfm thank you!!

@chancancode
Copy link
Member

@chancancode chancancode commented Feb 15, 2017

NTS: should be backported to 5-0-stable

@chancancode chancancode added this to the 5.0.x milestone 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)
chancancode added a commit that referenced this pull request Feb 24, 2017
5-0-stable backports: #27605 & #28013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants