aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/generators/rails/controller/USAGE
blob: 6ed4b2edfca60c102192f45f2d80c021034e523a (plain) (tree)
1
2
3
4
5
6
7
8
9






                                                                              

                                                                            








                                                                       
Description:
    Stubs out a new controller and its views. Pass the controller name, either
    CamelCased or under_scored, and a list of views 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 and test framework generators.

Example:
    `./script/generate controller CreditCard open debit credit close`

    Credit card controller with URLs like /credit_card/debit.
        Controller:      app/controllers/credit_card_controller.rb
        Functional Test: test/functional/credit_card_controller_test.rb
        Views:           app/views/credit_card/debit.html.erb [...]
        Helper:          app/helpers/credit_card_helper.rb