• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 16 years ago
  • Updated almost 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A custom builder (and some helper methods) for creating consistent and accessible forms in rails

Semantic Form Builder

Semantic Form Builder is a customer FormBuilder for use in Rails, aiming to give accessible, consistent, forms with the ultimate of DRY.

No more defining labels, worrying about formatting, etc. Let the default form_for tag take care of all the hassles for you

For an example of what it looks like check: http://rubypond.com/articles/2008/07/16/sexy-forms-in-rails/

Installation

$ script/plugin install git://github.com/rubypond/semantic-form-builder.git
$ rake semantic_form_builder:setup # (if the installation script didn't move the semantic_form.css into /public/stylesheets/)
  1. If you wish to use the builder to replace the default for all forms (which is great for consistency) then add the following into an initializer ActionView::Base.default_form_builder = SemanticFormBuilder. Otherwise pass the builder in as the :builder parameter for form_for.
  2. Be sure to include semantic_forms.css in your layout

Usage

Continue using form_for and the tag helpers within it as you did before and it should work fine. There has been a few additional tags added for convenience sake. They are:

  • submit_and_cancel
  • radio_button_group
  • check_box_group

More documentation on their usage to come, in the interim check out or the http://rubypond.com/articles/2008/07/16/sexy-forms-in-rails/ following example:

<% form_for @document do |f|
  field_set_tag "Form Details" do %>
    <%= f.date_select :date, :required => true, :help => "date the something happened" %>
    <%= f.text_field :number, :required => true, :help => "the reference number for this thing" %>
    <%= f.select :external_id, [["Choose an option...",""]] + @externals.map{|c| [c.name, c.id]}, :required => true, :label => "options", :help => "select something from the list" %>
    <%= check_box_tag_group "document[other_items][]", @others.map{|u| { :value => u.id, :label => u.description }}, :label => "including these?", :help => "tick the whatever boxes are appropriate for this&nbsp;thing" %>
    <%= f.text_field :name, :help => "what was Willis talkin' about?" %>
    <%= f.check_box :list, :label => "mailing list", :help => "can we send you a bunch of spam?" %>
    <%= f.submit_and_cancel("save", "cancel") %>
<% end %>

Analytics

More Repositories

1

monkeywrench

Simple ruby-esque wrapper for the Mailchimp API
Ruby
34
star
2

githooks

Some hooks to help catch errors and improve workflow with git
Ruby
24
star
3

hamstache

Combine Mustache logic-less templates with Haml
Ruby
18
star
4

heroku-exit-status

Extends the heroku client to return the true exit status
Ruby
11
star
5

git-based-deploy

Capistrano scripts for doing super quick deployments and rollbacks using Git
Ruby
9
star
6

activerecord_url_connections

Convert URLs into AR friendly hashes
Ruby
9
star
7

rails-database-url

Sets DATABASE_URL from database.yml
Ruby
8
star
8

nitrous.io-pairing-setup

Scripts, configs, and other things to make syncing files and pairing via Nitrous.io easier
Vim Script
7
star
9

rack_staging

Rack Middleware to protect staging environments from prying eyes
Ruby
6
star
10

cli-emulator

TypeScript
6
star
11

radiant-extension-search-referrer-terms

Extracts out the search terms entered into google/yahoo/msn/etc that have referred a user to your site
Ruby
4
star
12

maply

A ruby plugin for easily including maps in your web app
Ruby
3
star
13

godaddyapi

Go Daddy Reseller API Gem
Ruby
3
star
14

terraform-aws-ec2-agent-pool-autoscaler

HCL
3
star
15

dotfiles

Initial profile settings for new dev environments
Vim Script
2
star
16

kensa-go

Go
2
star
17

PLIBMTTBHGATY-Melbourne

1
star
18

dreamforce11-java-helloworld

Demo App for Dreamforce 11 - "hello world" on the Play framework
Java
1
star
19

terraform-demo-cost-estimation

HCL
1
star
20

terraform-demo-tfc-import

HCL
1
star
21

s3backup-manager

Scripts and daemon to manage encrypted backups on AmazonS3
Ruby
1
star
22

rack-syntax-highlighter

Ruby
1
star
23

terraform-aws-ecs-agent-pool

HCL
1
star
24

sentinel-policies

1
star
25

nesta.app

First pass at putting a cocoa app over NestaCMS
Ruby
1
star
26

objectbouncer

Ruby
1
star
27

every-api

My @Warblecamp "Everything is an API presentation"
Ruby
1
star
28

rack_fancy_ampersand

1
star
29

activerecord-concurrent-index

Concurrently adds database indexes
Ruby
1
star
30

sinatra-template

Base template for new Sinatra-based apps
Ruby
1
star
31

dreamforce11-ruby-blog

Demo App for Dreamforce 11 - A Padrino-based Blog
Ruby
1
star
32

bananasplit

Fork of http://www.bingocardcreator.com/abingo
Ruby
1
star
33

begin-app

Begin app
JavaScript
1
star
34

splunked

Searches splunk logs
Ruby
1
star
35

vscode-sentinel

VisualStudio Coded Language support for HashiCorp Sentinel
1
star
36

data-and-analytics

1
star
37

responsive-boilerplate

Compass extension to provide boilerplate responsive CSS
Ruby
1
star
38

terraform-aws-spa-static-site

HCL
1
star
39

honeybadger_import

Ruby
1
star
40

terraform-provider-meta

Go
1
star
41

facebook-coffeeshop

Demo app showing use of various Facebook APIs and the Open Graph
Ruby
1
star
42

rack_no_widow

Ruby
1
star