bootstrap_form 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/lib/bootstrap_form/form_builder.rb +1 -1
- data/lib/bootstrap_form/version.rb +1 -1
- data/test/bootstrap_form_test.rb +5 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -143,6 +143,12 @@ Use the `label` option if you want to specify the field's label text:
|
|
143
143
|
<%= f.password_field :password_confirmation, label: 'Confirm Password' %>
|
144
144
|
```
|
145
145
|
|
146
|
+
If you don't want to render the field's label, pass `:none` to the option:
|
147
|
+
|
148
|
+
```erb
|
149
|
+
<%= f.text_area :comment, label: :none, placeholder: 'Leave a comment...' %>
|
150
|
+
```
|
151
|
+
|
146
152
|
NOTE: To specify the label for a `control_group` you must do it like this:
|
147
153
|
|
148
154
|
```erb
|
data/test/bootstrap_form_test.rb
CHANGED
@@ -129,6 +129,11 @@ class BootstrapFormTest < ActionView::TestCase
|
|
129
129
|
assert_equal expected, @builder.text_field(:email, label: 'Email Address')
|
130
130
|
end
|
131
131
|
|
132
|
+
test "render the field without label" do
|
133
|
+
expected = %{<div class=\"control-group\"><div class=\"controls\"><input id=\"user_email\" name=\"user[email]\" size=\"30\" type=\"text\" value=\"steve@example.com\" /></div></div>}
|
134
|
+
assert_equal expected, @builder.text_field(:email, label: :none)
|
135
|
+
end
|
136
|
+
|
132
137
|
test "adding prepend text" do
|
133
138
|
expected = %{<div class=\"control-group\"><label class=\"control-label\" for=\"user_email\">Email</label><div class=\"controls\"><div class=\"input-prepend\"><span class=\"add-on\">Gmail</span><input id=\"user_email\" name=\"user[email]\" size=\"30\" type=\"text\" value=\"steve@example.com\" /></div></div></div>}
|
134
139
|
assert_equal expected, @builder.text_field(:email, prepend: 'Gmail')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|