diff options
author | Fumiaki MATSUSHIMA <mtsmfm@gmail.com> | 2016-12-22 19:21:11 +0900 |
---|---|---|
committer | Fumiaki MATSUSHIMA <mtsmfm@gmail.com> | 2017-01-03 21:18:09 +0900 |
commit | 085546df456139b6c5d2cde964133e93a0818571 (patch) | |
tree | 1cf387116f32d69653126dd9e7c63bb10f197414 /actionmailer | |
parent | 33e60514aed85b3076f2636d5f1ccfb513aace1c (diff) | |
download | rails-085546df456139b6c5d2cde964133e93a0818571.tar.gz rails-085546df456139b6c5d2cde964133e93a0818571.tar.bz2 rails-085546df456139b6c5d2cde964133e93a0818571.zip |
Fix generator command for nested (namespaced) rails engine
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.
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/rails/generators/mailer/mailer_generator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb index 4a8d0178de..519480e881 100644 --- a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb +++ b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb @@ -26,7 +26,7 @@ module Rails def application_mailer_file_name @_application_mailer_file_name ||= if mountable_engine? - "app/mailers/#{namespaced_path}/application_mailer.rb" + File.join("app/mailers", namespaced_path, "application_mailer.rb") else "app/mailers/application_mailer.rb" end |