Sha256: 58a4019f50110b62d4a76ab463307ab1e726f1d1e60273c15c932a1e270191d3

Contents?: true

Size: 1.78 KB

Versions: 7

Compression:

Stored size: 1.78 KB

Contents

= Formula

Formula is a Rails form generator that generates simple clean markup. The project aims to let users create semantically beautiful forms without introducing too much syntax. The goal is to make integrating advanced layout systems (such as grid systems) as simple as possible.

== Requirements

The gem has only been tested with Ruby 1.9.2 and Rails 3.0.3 but may well work with other versions of Ruby and Rails.

== Installation

  gem install formula
  
== Examples

  <% formula_form_for @user do |f| %>
    <%= f.input :email %>
    <%= f.input :password %>
    <%= f.button :submit %>
  <% end %>

  <% formula_form_for @user do |f| %>
    <%= f.input :email, :label => "Email:", :hint => "We promise never to bother you." %>
    <%= f.input :password, :label => "Password:", :hint => "Must be at least six characters." %>
    <%= f.button :submit %>
  <% end %>
  
  <% formula_form_for @company do |f|
    <%= f.input :url, :container => { :class => 'grid-04' } %>
    <%= f.input :phone, :container => { :class => 'grid-04' } %>
    <%= f.input :email, :container => { :class => 'grid-04' } %>
    <%= f.button :submit %>
  <% end %>
  
  <% formula_form_for @user do |f| %>
    <%= f.input :email, :label => "Email:" %>
    <%= f.input :password, :label => "Password:" %>
    <% formula_fields_for @user.payment do |payment_f| %>
      <%= payment_f.input :credit_card_number, :label => 'Number:' %>
      <%= payment_f.input :credit_card_expiration, :label => 'Expiration:' %>
    <% end %>
    <%= f.button :submit %>
  <% end %>
  
  <% formula_form_for @user do |f| %>
    <%= f.block :favourite %>
      <% @favourites.each do |favourite| %>
        ...
      <% end %>
    <% end %>
    <%= f.button :submit %>
  <% end %>
    
== Copyright

Copyright (c) 2010 Kevin Sylvestre. See LICENSE for details.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
formula-0.2.4 README.rdoc
formula-0.2.3 README.rdoc
formula-0.2.2 README.rdoc
formula-0.2.1 README.rdoc
formula-0.2.0 README.rdoc
formula-0.1.9 README.rdoc
formula-0.1.8 README.rdoc