Sha256: 81fcfae163c58caf89829a813d329b0927b89ae381e5f1709dc4c6c5efab77cb

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

Description:
    Scaffolds an entire resource, from model and migration to translation ready
    controller and views. The resource is ready to use as a starting point for
    your RESTful, resource-oriented application.

    Pass the 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'.

    For example, `jfs_scaffold article title:string content:text` gives you a
    model with those two attributes, a controller that handles the
    create/show/update/destroy, forms to create and edit your posts, and an
    index that lists them all, as well as a map.resources :posts declaration in
    config/routes.rb.

Examples:
    `./script/generate scaffold article title:string body:text published:boolean`

      Creates a model, migration, helper, controller, views and translation
      file:
        View:         app/views/article/index.html.erb
        View:         app/views/article/new.html.erb
        View:         app/views/article/show.html.erb
        View:         app/views/article/edit.html.erb
        View:         app/views/article/_fields.html.erb
        Translation:  config/locales/en.article.yml
        Controller:   app/controllers/articles_controller.rb
        Helper:       app/helpers/articles_helper.rb
        Model:        app/models/article.rb
        Migration:    db/migrate/XXX_create_articles.rb

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jfs-generators-0.2.0 rails_generators/jfs_scaffold/USAGE