Sha256: 6dfc8b7785031a24d744f2084f4f55e2c8163c304940d353ed6b22e66b5dc73c
Contents?: true
Size: 1.6 KB
Versions: 3
Compression:
Stored size: 1.6 KB
Contents
Description: Scaffolds an entire resource, from model and migration to controller and views, along with a full test suite. The resource is ready to use as a starting point for your RESTful, resource-oriented application. Pass the name of the model (preferably in singular form), and an optional list of attributes Attributes are declarations of the fields that you wish to store within a model. You can pass a type and list of options for each attribtue in the form: `name:type:options` if you do not provide a type, it is assumed that the attribute is of type `string_attr` Each model should have an hkey, if one is not present a `uuid:hkey` will be created for you. Timestamps are not added by default but you can add them using the `--timestamps` flag More information can be found at: https://github.com/awslabs/aws-record-generator/blob/master/README.md 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. For example, 'scaffold post title:hkey body published:boolean' gives you a model with those three 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 resources :posts declaration in config/routes.rb. If you want to remove all the generated files, run 'rails destroy scaffold ModelName'. Examples: `rails generate scaffold post title:hkey body published:boolean` `rails generate scaffold purchase amount:float:hkey tracking_id:integer:rkey`
Version data entries
3 entries across 3 versions & 2 rubygems