Sha256: fa4b4537e4eba6d188abe29e0f07740c31de9584a570c956d0cb849529e6ad8d

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 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 %>
  <% 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." %>
  <% 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' } %>
  <% 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 %>
  <% end %>
  
  <% formula_form_for @user do |f| %>
    <%= f.block :favourite %>
      <% @favourites.each do |favourite| %>
        ...
      <% end %>
    <% end %>
  <% end %>
    
== Copyright

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
formula-0.1.7 README.rdoc