Sha256: 30860fca9e676e0fd09ef7477246be4f516e1825760b5143f3fe10ac3b8ee27e

Contents?: true

Size: 1.13 KB

Versions: 61

Compression:

Stored size: 1.13 KB

Contents

Description:
    Stubs out a new resource including an empty model and controller suitable
    for a restful, resource-oriented application. Pass the singular model name,
    either CamelCased or under_scored, as the first argument, and an optional
    list of attribute pairs.

    Attribute pairs are column_name:sql_type arguments specifying the
    model's attributes. Timestamps are added by default, so you don't have to
    specify them by hand as 'created_at:datetime updated_at:datetime'.

    You don't have to think up every attribute up front, but it helps to
    sketch out a few so you can start working with the resource immediately.

    This creates a model, controller, helper, tests and fixtures for all of them,
    and the corresponding map.resources declaration in config/routes.rb

    Unlike the scaffold generator, the resource generator does not create
    views or add any methods to the generated controller.

Examples:
    `./script/generate resource post` # no attributes
    `./script/generate resource post title:string body:text published:boolean`
    `./script/generate resource purchase order_id:integer amount:decimal`

Version data entries

61 entries across 61 versions & 10 rubygems

Version Path
radiantcms-couchrest_model-0.1.9 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.8 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.7 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.6 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.5 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.4 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.3 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.2 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1.1 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.1 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
rails-2.3.10 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.9 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.9.pre lib/rails_generator/generators/components/resource/USAGE
webroar-0.4.0 src/admin_panel/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiant-0.9.1 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
rails-2.3.8 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.8.pre1 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.7 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.6 lib/rails_generator/generators/components/resource/USAGE
radiant-0.8.2 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE