Simple forms engine generator for Refinery CMS.
Refinery CMS version 3.0.0 or above.
Open up your Gemfile
and add at the bottom this line:
gem 'refinerycms-forms', git: 'https://github.com/refinery/refinerycms-forms', branch: 'master', group: :development
Now run bundle install
.
$ rails generate refinery:form job_inquiry name:string message:text job_type:radio brochure:checkbox qualification:select --authors 'John Jones'
Generates a custom forms 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.
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
The version of Refinery to develop this engine against is defined in the gemspec. To override the version of refinery to develop against, edit the project Gemfile to point to a local path containing a clone of refinerycms.
Generate the dummy application to test against
$ bundle exec rake refinery:testing:dummy_app
Run the test suite with Guard
$ bundle exec guard start
Or just with rake spec
$ bundle exec rake spec
- Check out our Website
- Help and documentation