Skip to content

refinery/refinerycms-forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Refinery CMS forms

Build Status

Simple forms engine generator for Refinery CMS.

Requirements

Refinery CMS version 3.0.0 or above.

Install

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.

Usage

Example:

$ rails generate refinery:form job_inquiry name:string message:text job_type:radio brochure:checkbox qualification:select --authors 'John Jones'

Description

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.

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

Developing & Contributing

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.

Testing

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

More Information