bootstrap-view-helpers 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## v 0.0.13
4
+
5
+ * added `form_actions`
6
+
3
7
  ## v 0.0.12
4
8
 
5
9
  * added `modal` and `modal_trigger` for Bootstrap modal dialogs
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 +#submit_tag()+ but:
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
- # <div class='form-actions'>
4
+ # <%= form_actions do %>
5
5
  # <%= submit_button_tag %>
6
6
  # <%= cancel_button_tag %>
7
- # </div>
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 ..."
@@ -6,9 +6,9 @@
6
6
  </label>
7
7
  </p>
8
8
 
9
- <div class='form-actions'>
9
+ <%= form_actions do %>
10
10
  <%= submit_button_tag %>
11
11
  <%= cancel_button_tag(url: '#') %>
12
- </div>
12
+ <% end %>
13
13
 
14
14
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module BootstrapViewHelpers
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
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.12
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-09 00:00:00.000000000 Z
12
+ date: 2013-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails