This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 450919c6b69b038d26283a6c0a7084fb58632190
tree 8094737342fd940ec87ff823e423eb8e471d3b9c
parent 7df495c62c2726501b2040cb7d18450c6748b048
tree 8094737342fd940ec87ff823e423eb8e471d3b9c
parent 7df495c62c2726501b2040cb7d18450c6748b048
| name | age | message | |
|---|---|---|---|
| |
README.textile | Wed Oct 01 12:09:54 -0700 2008 | |
| |
init.rb | Sat Sep 27 14:39:13 -0700 2008 | |
| |
lib/ | Sun Dec 07 01:23:24 -0800 2008 | |
| |
spec/ | Sat Sep 27 14:39:13 -0700 2008 |
README.textile
Uber builder
The greatest form builder for Ruby on Rails.
Why is it great?
- Tabular forms
- ul / li css forms
- Easily extensible
- Comes with a few useful extensions already
- Comes with a FormBuilder compliant StaticBuilder to render any form built with it as static.
How do I harness this greatness?
To create a basic form:
<% form_for @user do |f| %>
<h2>User details</h2>
<% f.table do %>
<% f.manual :label => "Name" do %>
<%= f.text_field :first_name %>
<%= f.text_field :last_name %>
<% end %>
<%= f.text_field :age %>
<% end %>
Billing information
<% f.table do %>
<%= f.text_field :address %>
… etc.
<% end %>
<% end %>
This form, out of the box, will be rendered as a table (with a class of form). To make the labels line up, you’ll want to add some CSS:
table.form td.label {
display:block;
width:200px;
font-weight:bold;
}
You can also render ul / li like so:
<% form_for @user do |f| %>
<h2>User details</h2>
<% f.ul do %>
...
<% end %>
<% end %>
The ul is rendered with a class of “form”. You’ll need to add css styling to make it work. Good luck with that.
Buy one get one free
If you extract that to a partial, _form.html.erb, then you could use if as a static view or a form
# render it as a form
<% form_for @user do |f| %>
<%= render :partial => "form", :locals => {:f => f} %>
<% end %>
# render it as static
<% form_for @user, :builder => StaticBuilder do |f| %>
<%= render :partial => "form", :locals => {:f => f} %>
<% end %>
I want to submit a patch
- Fork Uber-Builder
- Make your modification
- Add tests!
- Make sure all existing tests pass
- Send me a pull request on github
Author
Credits
Graeme Mathieson for writing the original TabularFormBuilder, which I used as a starting point for UberBuilder







