-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
doc/guides/4 - Refinery Extensions/6 - Generates a custom form.textile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
h2. Generates a custom form | ||
|
||
h3. Description | ||
|
||
Generates a custom form based extension for Refinery automatically. | ||
It works very similarly to the Refinery Engine generator. | ||
|
||
The first string attribute should always be the one which is the title or name field in your model. | ||
|
||
There must be at least one attribute. | ||
|
||
h3. Additional Supported Field Types | ||
|
||
All field types that are supported by the Refinery Engine generator are supported with the addition of these form specific ones: | ||
|
||
* radio - creates a set of radio buttons based off Model::FIELD_NAMES | ||
* checkbox - creates a checkbox for true/false values. | ||
* select - creates a select list with options using Model::FIELD_NAMES | ||
|
||
Example: | ||
<shell> | ||
$ rails generate refinery:form job_inquiry name:string message:text job_type:radio brochure:checkbox qualification:select | ||
</shell> |