Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails plugin to provide uni-form based forms (http://sprawsm.com/uni-form/)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 resources
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 assets.rb
Octocat-spinner-32 init.rb
Octocat-spinner-32 install.rb
Octocat-spinner-32 uninstall.rb
README.md

UniForm

A plugin for generating forms using http://sprawsm.com/uni-form

Installation

  ./script/plugin install git://github.com/antono/uni-form.git

Usage

  1. Include the Javascript file (probably in your layout). If You prefer Prototype.js: <%= javascript_include_tag 'uni-form.prototype.js' %> If using jQuery framework: <%= javascript_include_tag 'jquery.uni-form.js' %>

  2. Include the stylesheet (again, probably in your layout): <%= stylesheet_link_tag 'uni-form', :media => "all" %>

  3. Then, to create your form you can do the following:

    <% uni_form_for :user do |form| %>
      <% form.fieldset :type => "block", :legend => "cool stuff" do %>
    
        <%= form.text_field :first_name, :required => true, :label => "Your first name" %>
        <%= form.text_field :last_name %>
    
        <!-- multifield inputs -->
        <% form.multi_field :label => 'Sex', :hint => 'Pex!', :required => true do %>
          <%= form.radio_button(:sex, "Male", :label => 'Maaan', :checked => 'checked') %>
          <%= form.radio_button(:sex, "Female", :label => 'Wooman') %>
        <% end %>
        <!-- /multifield inputs -->
    
      <% end %>
      <%= form.submit "save" %>
    <% end %>
    

Credits

CSS and XTHML files provided by Dragan Babić under the terms of http://creativecommons.org/licenses/by-sa/2.5/

You can find original repository at: http://creativecommons.org/licenses/by-sa/2.5/

Rails plugin based on the original uni-form plugin by Marcus Irvin http://github.com/mirven/uni-form/tree and http://github.com/thewebfellas/uni-form/tree/master

Something went wrong with that request. Please try again.