bootstrap-view-helpers 0.0.12 → 0.0.13
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/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -298,9 +298,18 @@ See: http://twitter.github.io/bootstrap/javascript.html#collapse
|
|
298
298
|
|
299
299
|
### Form Helpers
|
300
300
|
|
301
|
+
#### form_actions
|
302
|
+
|
303
|
+
```erb
|
304
|
+
<%= form_actions do %>
|
305
|
+
<%= submit_button_tag %>
|
306
|
+
<%= cancel_button_tag(url: '#') %>
|
307
|
+
<% end %>
|
308
|
+
```
|
309
|
+
|
301
310
|
#### submit_tag_button
|
302
311
|
|
303
|
-
Returns <input> similar to
|
312
|
+
Returns <input> similar to `#submit_tag()` but:
|
304
313
|
* styled like a Bootstrap button, type `:primary`
|
305
314
|
* has `:disable_with` set to "Processing ..."
|
306
315
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Rails helper methods associated with forms for Bootstrap.
|
2
2
|
#
|
3
3
|
# @example Bootstrap form-actions <div>
|
4
|
-
#
|
4
|
+
# <%= form_actions do %>
|
5
5
|
# <%= submit_button_tag %>
|
6
6
|
# <%= cancel_button_tag %>
|
7
|
-
#
|
7
|
+
# <% end %>
|
8
8
|
#
|
9
9
|
module Bootstrap::FormHelper
|
10
10
|
ArgumentError = Class.new(StandardError)
|
@@ -41,6 +41,19 @@ module Bootstrap::FormHelper
|
|
41
41
|
button(*args, options)
|
42
42
|
end
|
43
43
|
|
44
|
+
# Convience method for Bootstrap form action DIV.
|
45
|
+
#
|
46
|
+
# @param options [Hash] options become html attributes of returned <div>
|
47
|
+
# @return [String] <div> with yielded block
|
48
|
+
def form_actions(options={})
|
49
|
+
options = canonicalize_options(options)
|
50
|
+
options = ensure_class(options, 'form-actions')
|
51
|
+
|
52
|
+
content_tag(:div, options) do
|
53
|
+
yield
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
44
57
|
# Returns <input> similar to +#submit_tag()+ but: x
|
45
58
|
# * styled like a Bootstrap button, type :primary
|
46
59
|
# * has +:disable_with+ set to "Processing ..."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-view-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
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-06-
|
12
|
+
date: 2013-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|