No commit activity in last 3 years
No release in over 3 years
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 as simple as possible.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

> 3.0.0
 Project Readme

Formula¶ ↑

Formula is a Rails form helper that generates awesome markup. The project lets users create semantically beautiful forms without introducing too much syntax.

Requirements¶ ↑

The gem is tested with:

  • Ruby on Rails 4.1.8

  • Ruby 2.1.5

  • Ruby 2.0.0

  • Ruby 1.9.3

  • JRuby

Installation¶ ↑

gem install formula

Examples¶ ↑

<% formula_form_for @user do |f| %>
  <%= f.input :email %>
  <%= f.input :password %>
  <%= f.button 'Save' %>
<% 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 'Save' %>
<% end %>

<% formula_form_for @company do |f|
  <%= f.input :url,   container: { class: 'third' }, input: { class: 'fill' } %>
  <%= f.input :phone, container: { class: 'third' }, input: { class: 'fill' } %>
  <%= f.input :email, container: { class: 'third' }, input: { class: 'fill' } %>
  <%= f.button 'Save', button: { class: 'fancy' } %>
<% end %>

<% formula_form_for @user do |f| %>
  <%= f.input :email, label: "Email:" %>
  <%= f.input :password, label: "Password:" %>
  <%= f.input :gender, label: 'Gender:', as: :select, choices: User::GENDERS %>
  <% 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 'Save', button: { class: 'fancy' } %>
<% end %>

<% formula_form_for @user do |f| %>
  <%= f.block :favourite %>
    <% @favourites.each do |favourite| %>
      ...
    <% end %>
  <% end %>
  <%= f.button 'Save', button: { class: 'fancy' } %>
<% end %>

Contributors¶ ↑

  • Iliya Grushevskiy

Status¶ ↑

<img src=“http://img.shields.io/gemnasium/ksylvest/formula.svg” /> <img src=“http://img.shields.io/travis/ksylvest/formula.svg” /> <img src=“http://img.shields.io/codeclimate/github/ksylvest/formula.svg” />

Copyright © 2010 - 2014 Kevin Sylvestre. See LICENSE for details.