bootstrap_form 0.3.1 → 0.3.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.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
@@ -78,7 +78,7 @@ module BootstrapForm
78
78
  content_tag(:div, options) do
79
79
  html = ''
80
80
 
81
- if label
81
+ if label && label[:text] != :none
82
82
  label[:class] ||= 'control-label'
83
83
  label[:for] ||= '' if name.nil?
84
84
 
@@ -1,3 +1,3 @@
1
1
  module BootstrapForm
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -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.1
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-05 00:00:00.000000000 Z
12
+ date: 2013-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails