Skip to content

Commit

Permalink
Added initial usage documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Wiklund committed Jul 15, 2014
1 parent e3e87aa commit 1024a3e
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,33 @@ Or install it yourself as:

$ gem install trans_forms

## Usage
## Writing Form Models

TODO: Write usage instructions here
Form Models inherit from `TransForms::FormBase` and live in the `app/trans_forms`
directory of your application.

# app/trans_forms/post_form.rb
class PostForm < TransForms::FormBase
# ...
end

### Generators

To manually generate a Form Model, you can run...

rails g trans_form PostForm

... to create a `PostForm` Form Model.

### Shared Form Model Methods

You might want to add some default functionality to all your Form Models. The common
practice to accomplish this is to have an application specific model that inherits
from the FormBase. Then you have all of your FormModels inherit from this model instead.

You can generate a default model like this by running:

TODO: Add generator

## Contributing

Expand Down

0 comments on commit 1024a3e

Please sign in to comment.