diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb | 4 | ||||
-rw-r--r-- | railties/test/generators/resource_generator_test.rb | 6 |
2 files changed, 1 insertions, 9 deletions
diff --git a/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb b/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb index 17d22768ed..7472e5f071 100644 --- a/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb +++ b/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb @@ -24,9 +24,7 @@ module Rails end # inserts the primary resource - resources = "resources :#{file_name.pluralize}" - resources << ", except: [:new, :edit]" if options.api? - write(resources, route_length + 1) + write("resources :#{file_name.pluralize}", route_length + 1) # ends blocks regular_class_path.each_index do |index| diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index f73169c6fb..581d80d60e 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -85,10 +85,4 @@ class ResourceGeneratorTest < Rails::Generators::TestCase assert_no_match(/resources :accounts$/, route) end end - - def test_api_only_does_not_generate_edit_route - run_generator ["Account", "--api"] - - assert_file "config/routes.rb", /resources :accounts, except: \[:new, :edit\]$/ - end end |