Formful
Reflect HTML forms from Resourceful resources.
Warning: Formful is a very young project. You might find it's still rough around the edges. Act accordingly!
Installation
npm install formful
Features
- Zero-configuration HTML form generation with optional backend
- Full Resourceful resource integration ( persistence / validation / schema )
- Built with Twitter Bootstrap and Viewful
Online Demo
Usage
Define resource(s)
var resourceful = Creature = resourceful; Creature;Creature;Creature;
additional API documentation for defining resources
As a stand-alone server
var formful = ;formful;
Here is a code example of using formful as a stand-alone server: https://github.com/flatiron/formful/blob/master/examples/server.js
Validation
Formful will respect Resourceful validation through revalidator. Not all property types and formats are fully implemented in Formful yet, but they are all coming soon.
Here is an example of trying to create a new creature without a valid email. Bad creature!
Persistence
Formful persists to data-providers using Resourceful. You can find more information about Resourceful here.
Customization of forms
As of the formful v0.1.0
release, form customization is not so awesome. This will be improved soon.
The form View is created by the viewful library and is a viewful.View
instance. Viewful provides a rich set of features including support for 22 different JavaScript templating engines.
Currently, all forms and form components are stored as plain html files. Formful currently uses no templating engine. All rendering and data-binding is currently handled through a Presenter for each view. This is not ideal, and will be changing soon.
Tests
npm test
TODO
- Add integration tests for all browsers ( coming very soon )
- Make isomorphic ( blocked by
Viewful
) - Full
revalidator
property type support ( numeric, boolean, array, object ) - Better Twitter Bootstrap component integration / styling
- Replace all string concats
- Implement Flatiron plugin / Add Flatiron example
- Fully implement relational resources