Sha256: 3e1e269ca3bf508b6ff7ccf502b4d262a0ec1c778a00d4c5cb5e72d05c16d84e

Contents?: true

Size: 1.12 KB

Versions: 39

Compression:

Stored size: 1.12 KB

Contents

Description:
    Generates a new controller and its views. Pass the controller name, either
    CamelCased or under_scored, and a list of actions as arguments.

    To create a controller within a module, specify the controller name as a
    path like 'parent_module/controller_name'.

    This generates a controller class in app/controllers and invokes helper,
    template engine, assets, and test framework generators.

Examples:
    `bin/rails generate controller credit_cards open debit credit close`

    This generates a `CreditCardsController` with routes like /credit_cards/debit.
        Controller: app/controllers/credit_cards_controller.rb
        Test:       test/controllers/credit_cards_controller_test.rb
        Views:      app/views/credit_cards/debit.html.erb [...]
        Helper:     app/helpers/credit_cards_helper.rb

    `bin/rails generate controller users index --skip-routes`

    This generates a `UsersController` with an index action and no routes.

    `bin/rails generate controller admin/dashboard --parent=admin_controller`

    This generates a `Admin::DashboardController` with an `AdminController` parent class.

Version data entries

39 entries across 39 versions & 5 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/generators/rails/controller/USAGE
railties-8.0.1 lib/rails/generators/rails/controller/USAGE
railties-8.0.0.1 lib/rails/generators/rails/controller/USAGE
railties-7.2.2.1 lib/rails/generators/rails/controller/USAGE
railties-7.1.5.1 lib/rails/generators/rails/controller/USAGE
railties-8.0.0 lib/rails/generators/rails/controller/USAGE
railties-7.2.2 lib/rails/generators/rails/controller/USAGE
railties-7.1.5 lib/rails/generators/rails/controller/USAGE
railties-8.0.0.rc2 lib/rails/generators/rails/controller/USAGE
railties-7.2.1.2 lib/rails/generators/rails/controller/USAGE
railties-7.1.4.2 lib/rails/generators/rails/controller/USAGE
railties-8.0.0.rc1 lib/rails/generators/rails/controller/USAGE
railties-7.2.1.1 lib/rails/generators/rails/controller/USAGE
railties-7.1.4.1 lib/rails/generators/rails/controller/USAGE
railties-8.0.0.beta1 lib/rails/generators/rails/controller/USAGE
omg-railties-8.0.0.alpha9 lib/rails/generators/rails/controller/USAGE
omg-railties-8.0.0.alpha8 lib/rails/generators/rails/controller/USAGE
omg-railties-8.0.0.alpha7 lib/rails/generators/rails/controller/USAGE
omg-railties-8.0.0.alpha4 lib/rails/generators/rails/controller/USAGE
omg-railties-8.0.0.alpha3 lib/rails/generators/rails/controller/USAGE