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