mbleigh-uberkit 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +72 -0
- data/lib/uberkit.rb +2 -1
- metadata +3 -3
data/README
CHANGED
|
@@ -16,6 +16,78 @@ To install it as a plugin (Rails 2.1 or later):
|
|
|
16
16
|
|
|
17
17
|
script/plugin install git://github.com/mbleigh/uberkit.git
|
|
18
18
|
|
|
19
|
+
UberForms
|
|
20
|
+
---------
|
|
21
|
+
|
|
22
|
+
UberForms provide a simple context for building forms in a DRYer
|
|
23
|
+
manner by abstracting the markup into a simple, CSS-styleable
|
|
24
|
+
format. It is available as a form builder as Uberkit::Forms::Builder,
|
|
25
|
+
but is likely more useful when used in one of the helper forms:
|
|
26
|
+
uberform_for or remote_uberform_for.
|
|
27
|
+
|
|
28
|
+
=== Basic Example
|
|
29
|
+
|
|
30
|
+
<% uberform_for :user do |f| %>
|
|
31
|
+
<%= f.text_field :login %>
|
|
32
|
+
<%= f.password_field :password %>
|
|
33
|
+
<%= f.submit "Submit"%>
|
|
34
|
+
<% end %>
|
|
35
|
+
|
|
36
|
+
Becomes...
|
|
37
|
+
|
|
38
|
+
<form method="post" class="uberform" action="/users">
|
|
39
|
+
<div class="field_row">
|
|
40
|
+
<label for="user_login">Login:</label>
|
|
41
|
+
<input type="text" size="30" name="user[login]" id="user_login" class="text_field"/>
|
|
42
|
+
<br/>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="field_row">
|
|
45
|
+
<label for="user_password">Password:</label>
|
|
46
|
+
<input type="password" size="30" name="user[password]" id="user_password" class="password_field"/>
|
|
47
|
+
<br/>
|
|
48
|
+
</div>
|
|
49
|
+
<button type="submit">Submit</button>
|
|
50
|
+
</form>
|
|
51
|
+
|
|
52
|
+
=== Labels, Help, and Descriptions
|
|
53
|
+
|
|
54
|
+
You can pass options into a given field to set a custom label,
|
|
55
|
+
some help text, or a description of the field.
|
|
56
|
+
|
|
57
|
+
<%= f.text_field :login, :label => "Username",
|
|
58
|
+
:help => "Only a-z and underscores.",
|
|
59
|
+
:description => "The name you will use to log in." %>
|
|
60
|
+
|
|
61
|
+
Becomes...
|
|
62
|
+
|
|
63
|
+
<div class="field_row">
|
|
64
|
+
<label for="user_login">Username:</label>
|
|
65
|
+
<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"/>
|
|
66
|
+
<span class="help">Only a-z and underscores.</span>
|
|
67
|
+
<span class="description">The name you will use to log in.</span>
|
|
68
|
+
<br/>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
=== Custom Fields
|
|
72
|
+
|
|
73
|
+
Maybe the built-in form helpers won't do it for you. In that case, you
|
|
74
|
+
can use the custom helper to insert arbitrary HTML that still plays
|
|
75
|
+
nice with the rest of UberForms:
|
|
76
|
+
|
|
77
|
+
<% f.custom :label => "State", :for => "user_state" do |f| %>
|
|
78
|
+
<%= state_select :user, :state %>
|
|
79
|
+
<% end %>
|
|
80
|
+
|
|
81
|
+
Becomes...
|
|
82
|
+
|
|
83
|
+
<div class="field_row">
|
|
84
|
+
<label for="user_state">State:</label>
|
|
85
|
+
<div class="pseudo_field">
|
|
86
|
+
<select id="user_state">...</select>
|
|
87
|
+
</div>
|
|
88
|
+
<br/>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
19
91
|
UberMenu
|
|
20
92
|
--------
|
|
21
93
|
|
data/lib/uberkit.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mbleigh-uberkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Bleigh
|
|
@@ -9,11 +9,11 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-07-
|
|
12
|
+
date: 2008-07-14 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
16
|
-
description: UberKit is a set of tools for common UI problems in Rails including menus.
|
|
16
|
+
description: UberKit is a set of tools for common UI problems in Rails including menus and forms.
|
|
17
17
|
email: michael@intridea.com
|
|
18
18
|
executables: []
|
|
19
19
|
|