# frozen_string_literal: true

require "rails/generators/rails/resource/resource_generator"

module Rails
  module Generators
    class ScaffoldGenerator < ResourceGenerator # :nodoc:
      remove_hook_for :resource_controller
      remove_class_option :actions

      class_option :api, type: :boolean
      class_option :resource_route, type: :boolean

      hook_for :scaffold_controller, required: true
    end
  end
end

# frozen_string_literal: true

require "rails/generators/rails/resource/resource_generator"

module Rails
  module Generators
    class ScaffoldGenerator < ResourceGenerator # :nodoc:
      remove_hook_for :resource_controller
      remove_class_option :actions

      class_option :api, type: :boolean,
        desc: "Generate API-only controller and tests, with no view templates"
      class_option :resource_route, type: :boolean

      hook_for :scaffold_controller, required: true
    end
  end
end

Clarify description of --api option
Clarify description of --api option

"Indicates when to generate api" doesn't make sense:

```
$ bin/rails g scaffold | grep api
      [--api], [--no-api]                                    # Indicates when to generate api
```

Co-authored-by: Jonathan Hefner <3692bfa45759a67d83aedf0045f6cb635a966abf@hefner.pro>
