Sha256: b455c76248a95f2b1da85e0e03ef52ef59f434c905e6d4db6a8d77eb39faa396

Contents?: true

Size: 1.79 KB

Versions: 1

Compression:

Stored size: 1.79 KB

Contents

Description:
    The extension_controller generator creates stubs for a new controller and 
    its views for an extension.
  
    The generator takes an extension name, controller name, and a list of 
    views as arguments.  The controller name may be given in CamelCase or 
    under_score and should not be suffixed with 'Controller'.  To create a 
    controller within a module, specify the controller name as 
    'module/controller'.

    The generator creates a controller class in 
    vendor/extension_name/app/controllers with view templates in 
    vendor/extension_name/app/views/controller_name, a helper class in 
    vendor/extension_name/app/helpers, and a functional test suite in 
    vendor/extension_name/test/functional.

Example:
    rails generate extension_controller MyExt Assets list show

    Controller: vendor/my_ext/app/controllers/assets_controller.rb
    Views:      vendor/my_ext/app/views/assets/list.rhtml [...]
    Helper:     vendor/my_ext/app/helpers/assets_helper.rb
    Spec:       vendor/my_ext/spec/controllers/assets_controller_spec.rb
    Test:       vendor/my_ext/test/functional/assets_test.rb (if extension created with "--with-test-unit")

Modules Example:
    rails generate extension_controller MyExt 'admin/assets' upload remove

    Controller: vendor/my_ext/app/controllers/admin/assets_controller.rb
    Views:      vendor/my_ext/app/views/admin/assets/upload.rhtml [...]
    Helper:     vendor/my_ext/app/helpers/admin/assets_helper.rb
    Spec:       vendor/my_ext/spec/controllers/admin/assets_controller_spec.rb
    Test:       vendor/my_ext/test/functional/admin/assets_controller_test.rb (if extension created with "--with-test-unit")
    
Note: Once you have created an extension controller you will still need to
map routes to the controller in the extension file.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiant-rails3-0.1 lib/generators/extension_controller/USAGE