0
@@ -16,6 +16,78 @@ To install it as a plugin (Rails 2.1 or later):
0
script/plugin install git://github.com/mbleigh/uberkit.git
0
+UberForms provide a simple context for building forms in a DRYer
0
+manner by abstracting the markup into a simple, CSS-styleable
0
+format. It is available as a form builder as Uberkit::Forms::Builder,
0
+but is likely more useful when used in one of the helper forms:
0
+uberform_for or remote_uberform_for.
0
+<% uberform_for :user do |f| %>
0
+ <%= f.text_field :login %>
0
+ <%= f.password_field :password %>
0
+ <%= f.submit "Submit"%>
0
+<form method="post" class="uberform" action="/users">
0
+ <div class="field_row">
0
+ <label for="user_login">Login:</label>
0
+ <input type="text" size="30" name="user[login]" id="user_login" class="text_field"/>
0
+ <div class="field_row">
0
+ <label for="user_password">Password:</label>
0
+ <input type="password" size="30" name="user[password]" id="user_password" class="password_field"/>
0
+ <button type="submit">Submit</button>
0
+=== Labels, Help, and Descriptions
0
+You can pass options into a given field to set a custom label,
0
+some help text, or a description of the field.
0
+<%= f.text_field :login, :label => "Username",
0
+ :help => "Only a-z and underscores.",
0
+ :description => "The name you will use to log in." %>
0
+<div class="field_row">
0
+ <label for="user_login">Username:</label>
0
+ <input type="text" size="30" name="user[login]" label="Username" id="user_login" help="Only a-z and underscores." description="The name you will use to log in." class="text_field"/>
0
+ <span class="help">Only a-z and underscores.</span>
0
+ <span class="description">The name you will use to log in.</span>
0
+Maybe the built-in form helpers won't do it for you. In that case, you
0
+can use the custom helper to insert arbitrary HTML that still plays
0
+nice with the rest of UberForms:
0
+<% f.custom :label => "State", :for => "user_state" do |f| %>
0
+ <%= state_select :user, :state %>
0
+<div class="field_row">
0
+ <label for="user_state">State:</label>
0
+ <div class="pseudo_field">
0
+ <select id="user_state">...</select>
Hi, seems it doesn’t work on rails 2.2 HEAD:
Thnaks for the nice plugin! Ettore