public
Rubygem
Description: The UberKit is a Rails plugin with a set of UI tools to ease common development.
Homepage: http://www.actsascommunity.com/projects/uberkit
Clone URL: git://github.com/mbleigh/uberkit.git
Added UberForms to the Uberkit.
mbleigh (author)
Mon Jul 14 12:20:26 -0700 2008
commit  c219287abaab27727a995d82106764a982a705ca
tree    c3ba08525c99bd14b6a54645aa513e251326ec17
parent  7894d8aa1f5a74cced5e2ecd9abf2b3fff08f8e0
0
...
16
17
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
20
21
...
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
0
@@ -16,6 +16,78 @@ To install it as a plugin (Rails 2.1 or later):
0
 
0
   script/plugin install git://github.com/mbleigh/uberkit.git
0
   
0
+UberForms
0
+---------
0
+
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
+
0
+=== Basic Example
0
+
0
+<% uberform_for :user do |f| %>
0
+  <%= f.text_field :login %>
0
+  <%= f.password_field :password %>
0
+  <%= f.submit "Submit"%>
0
+<% end %>
0
+
0
+Becomes...
0
+
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
+    <br/>
0
+  </div>
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
+    <br/>
0
+  </div>
0
+  <button type="submit">Submit</button>
0
+</form>
0
+
0
+=== Labels, Help, and Descriptions
0
+
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
+
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
+
0
+Becomes...
0
+
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
+  <br/>
0
+</div>
0
+
0
+=== Custom Fields
0
+
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
+
0
+<% f.custom :label => "State", :for => "user_state" do |f| %>
0
+  <%= state_select :user, :state %>
0
+<% end %>
0
+
0
+Becomes...
0
+
0
+<div class="field_row">
0
+  <label for="user_state">State:</label>
0
+  <div class="pseudo_field">
0
+    <select id="user_state">...</select>
0
+  </div> 
0
+  <br/>
0
+</div>
0
+
0
 UberMenu
0
 --------
0
 
...
1
2
3
 
 
4
...
1
 
2
3
4
5
0
@@ -1,2 +1,3 @@
0
 require 'uberkit/displayer'
0
-require 'uberkit/menu'
0
\ No newline at end of file
0
+require 'uberkit/menu'
0
+require 'uberkit/form'
0
\ No newline at end of file
...
1
2
3
4
 
 
5
6
7
8
 
9
10
11
...
1
2
 
 
3
4
5
6
7
 
8
9
10
11
0
@@ -1,11 +1,11 @@
0
 Gem::Specification.new do |s|
0
   s.name = "uberkit"
0
-  s.version = "0.0.1"
0
-  s.date = "2008-07-07"
0
+  s.version = "0.0.2"
0
+  s.date = "2008-07-14"
0
   s.summary = "A Rails plugin for a common set of UI tools and helpers for building interfaces."
0
   s.email = "michael@intridea.com"
0
   s.homepage = "http://www.actsascommunity.com/projects/uberkit"
0
-  s.description = "UberKit is a set of tools for common UI problems in Rails including menus."
0
+  s.description = "UberKit is a set of tools for common UI problems in Rails including menus and forms."
0
   s.has_rdoc = false
0
   s.authors = ["Michael Bleigh"]
0
   s.files = [ "MIT-LICENSE",

Comments

ack-ack Mon Sep 01 06:54:14 -0700 2008

Hi, seems it doesn’t work on rails 2.2 HEAD:


ActionView::TemplateError (undefined method `output_buffer=' for #<Uberkit::Forms::Builder:0x1fd7e3c>) on line #1 of app/views//_form.html.erb:
1:   <%= f.text_field :title %>

vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:132:in `with_output_buffer'
    vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:39:in `capture'
    vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:71:in `content_tag'
    vendor/plugins/uberkit/lib/uberkit/forms/builder.rb:22:in `generic_field'
    vendor/plugins/uberkit/lib/uberkit/forms/builder.rb:16:in `text_field'
    app/views/ammin/posts/_form.html.erb:1

Thnaks for the nice plugin! Ettore