diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-02-22 08:39:37 +0900 |
---|---|---|
committer | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-02-22 08:39:37 +0900 |
commit | 651c2492f079cc2e37bf8e93a9fd23bde1e5349e (patch) | |
tree | b259fadcebddd2cda32074d299cb6b717c32fa64 /railties/lib | |
parent | 63d530c5e68a8cf53603744789f53ccbc7ac1a0e (diff) | |
download | rails-651c2492f079cc2e37bf8e93a9fd23bde1e5349e.tar.gz rails-651c2492f079cc2e37bf8e93a9fd23bde1e5349e.tar.bz2 rails-651c2492f079cc2e37bf8e93a9fd23bde1e5349e.zip |
Do not add routes when actions are not specified
Since #30241, if namepsace is specified, routes will be generated even
if there is no actions.
However, it seems that this behavior is not intentionally added behavior.
As with 5.1, routes should not be generated if actions are not specified.
Fixes #32072.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/controller/controller_generator.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/controller/controller_generator.rb b/railties/lib/rails/generators/rails/controller/controller_generator.rb index 6d45d6e8f8..6e2495d45f 100644 --- a/railties/lib/rails/generators/rails/controller/controller_generator.rb +++ b/railties/lib/rails/generators/rails/controller/controller_generator.rb @@ -16,6 +16,7 @@ module Rails def add_routes return if options[:skip_routes] + return if actions.empty? route generate_routing_code end |