module Formize

Formize

Gem Version

Form helpers. Will be integrated with SimpleForm.

Installation

Add to your Gemfile these fllowing lines:

gem "jquery-rails" # Need to be explicitly specified
gem "formize"

Assets and configurations

Formize comes with basic scripts and stylesheets which must be included in the layout (at least at the start).

In Rails 3.0.x

Formize requires the gem jquery-rails, so if you don't already use it:

rails generate jquery:install --ui

Then install formize in your app like jquery-rails:

rails generate formize:install

These previous commands install all the needed files in your public/ directory. Then the files can be included with an helper:

# app/views/layouts/application.html.erb
<%= formize_include_tag -%>

In Rails ≥ 3.1

With the asset pipeline, there is no need to run generators or copy files. So for stylesheets:

# app/assets/stylesheets/application.css
*= require formize

And for javascripts:

# app/assets/javascripts/application.js
*= require formize

Default configuration file

To install the default configuration file (config/initializers/formize.rb), the generator must be run:

rails generate formize:install

Usage

TODO: Rewrite examples

Date

Datetime

Unroll (replacement of ComboBox)

MonoChoice (dynamic selector)

Contributing to Formize

Copyright © 2011 Brice Texier. See LICENSE.txt for further details.

Constants

DATE_FORMAT_TOKENS
TIME_FORMAT_TOKENS

Public Class Methods

foreign_key() click to toggle source
# File lib/formize.rb, line 8
def self.foreign_key
  :foreign_key
end