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
rails-2.3.18 lib/rails_generator/generators/components/resource/USAGE
rails_csi-2.3.5.p8 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.17 lib/rails_generator/generators/components/resource/USAGE
rails_csi-2.3.5.p7 lib/rails_generator/generators/components/resource/USAGE
rails_csi-2.3.5.p6 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.16 lib/rails_generator/generators/components/resource/USAGE
rails-2.3.15 lib/rails_generator/generators/components/resource/USAGE
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rails-2.3.14/lib/rails_generator/generators/components/resource/USAGE
vanity-1.7.1 vendor/ruby/1.9.1/gems/rails-2.3.12/lib/rails_generator/generators/components/resource/USAGE
rails-2.3.14 lib/rails_generator/generators/components/resource/USAGE
kajam-1.0.3.rc2 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
rails-2.3.12 lib/rails_generator/generators/components/resource/USAGE
radiant-1.0.0.rc2 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiant-1.0.0.rc1 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
webroar-0.5.0 src/admin_panel/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
rails-2.3.11 lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.2.4 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.2.2 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.2.1 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE
radiantcms-couchrest_model-0.2 vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE