Sha256: 56ad6e5be0f7f25c21b59f0204020bdb1cc6de25700bb44750f500398c00593d

Contents?: true

Size: 1.77 KB

Versions: 2

Compression:

Stored size: 1.77 KB

Contents

= Formula

Formula is a Rails form helper that generates awesome 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 is tested with Ruby 1.9.2 and Rails 3.0.6 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 - 2011 Kevin Sylvestre. See LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
formula-0.2.6 README.rdoc
formula-0.2.5 README.rdoc