simple_form_bootstrap3 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a9696b44cc9a69cc3ffd208812aae7d77dfc743
4
- data.tar.gz: e13ebafdc5aba29959628d407cc8c399b8f86bd0
3
+ metadata.gz: 61b06399de22ad4d50ed682a2a013794cb6eaa9a
4
+ data.tar.gz: 7dbf699f924c5fa7e48c95ec9f41f404a3628bea
5
5
  SHA512:
6
- metadata.gz: 4b00bf9a5e0b7ab3425e9932fae0934f23b4b7d58e093068df66d6a7cdca39a4c659fd5f763cfc26cc430db056a403ad4b7f6c98956e3bd34715a08f921340ad
7
- data.tar.gz: 921b60c3a7ce280055894f1f27ea08f9f9a203c30ab09712f47fdd5e75652ec9d608f88b8893bf10a84969475b2f8202e1577352ca2172e19a080c7cd702997b
6
+ metadata.gz: ca6754dc2d246eef08f4e83dfa31532b0b8aea679cb69e705e820e03c870ee6c7c74a5caf8f7439091272f7120d1306f894ef59bfe2d35d18070d497e3faaa54
7
+ data.tar.gz: b1828714d89618f3f2550525036b3566a661d4399b0dd2636a2ef7d10203fef40156e903966f681c38d900fc100116dee9a79ec51a530b54d07a7ca0408cfb55
@@ -22,6 +22,16 @@ module SimpleForm
22
22
  simple_form_for object, *(args << options), &block
23
23
  end
24
24
 
25
+ def compact_form_for(object, *args, &block)
26
+ options = args.extract_options!
27
+ options[:wrapper] ||= :default
28
+ options[:builder] ||= SimpleForm::PlaceholderFormBuilder
29
+ options[:html] ||= {}
30
+ options[:html][:role] = 'form'
31
+
32
+ simple_form_for object, *(args << options), &block
33
+ end
34
+
25
35
  def inline_form_for(object, *args, &block)
26
36
  options = args.extract_options!
27
37
  options[:wrapper] ||= :inline
@@ -2,6 +2,7 @@ module SimpleForm
2
2
  class DefaultFormBuilder < SimpleForm::FormBuilder
3
3
  def checkbox(attribute_name, options = {}, &block)
4
4
  options[:wrapper] ||= :checkbox
5
+ options[:as] ||= :boolean
5
6
  input attribute_name, options, &block
6
7
  end
7
8
 
@@ -1,13 +1,13 @@
1
1
  module SimpleForm
2
- class HorizontalFormBuilder < SimpleForm::FormBuilder
2
+ class HorizontalFormBuilder < SimpleForm::DefaultFormBuilder
3
3
  def checkbox(attribute_name, options = {}, &block)
4
4
  options[:wrapper] ||= :horizontal_checkbox
5
- input attribute_name, options, &block
5
+ super
6
6
  end
7
7
 
8
8
  def radio(attribute_name, options = {}, &block)
9
9
  options[:wrapper] ||= :horizontal_radio
10
- input attribute_name, options, &block
10
+ super
11
11
  end
12
12
 
13
13
  def buttons(options = {}, &block)
@@ -2,12 +2,12 @@ module SimpleForm
2
2
  class InlineFormBuilder < SimpleForm::PlaceholderFormBuilder
3
3
  def checkbox(attribute_name, options = {}, &block)
4
4
  options[:wrapper] ||= :inline_checkbox
5
- input attribute_name, options, &block
5
+ super
6
6
  end
7
7
 
8
8
  def radio(attribute_name, options = {}, &block)
9
9
  options[:wrapper] ||= :inline_radio
10
- input attribute_name, options, &block
10
+ super
11
11
  end
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  module SimpleForm
2
- class PlaceholderFormBuilder < SimpleForm::FormBuilder
2
+ class PlaceholderFormBuilder < SimpleForm::DefaultFormBuilder
3
3
  def input(attribute_name, options = {}, &block)
4
4
  if options[:placeholder].nil?
5
5
  options[:placeholder] ||= object.class.respond_to?(:human_attribute_name) ?
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBootstrap3
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_bootstrap3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuriy Kolodovskyy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-sass