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 +4 -4
- data/lib/simple_form/action_view_extensions/bootstrap_form_helper.rb +10 -0
- data/lib/simple_form/default_form_builder.rb +1 -0
- data/lib/simple_form/horizontal_form_builder.rb +3 -3
- data/lib/simple_form/inline_form_builder.rb +2 -2
- data/lib/simple_form/placeholder_form_builder.rb +1 -1
- data/lib/simple_form_bootstrap3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61b06399de22ad4d50ed682a2a013794cb6eaa9a
|
4
|
+
data.tar.gz: 7dbf699f924c5fa7e48c95ec9f41f404a3628bea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module SimpleForm
|
2
|
-
class HorizontalFormBuilder < SimpleForm::
|
2
|
+
class HorizontalFormBuilder < SimpleForm::DefaultFormBuilder
|
3
3
|
def checkbox(attribute_name, options = {}, &block)
|
4
4
|
options[:wrapper] ||= :horizontal_checkbox
|
5
|
-
|
5
|
+
super
|
6
6
|
end
|
7
7
|
|
8
8
|
def radio(attribute_name, options = {}, &block)
|
9
9
|
options[:wrapper] ||= :horizontal_radio
|
10
|
-
|
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
|
-
|
5
|
+
super
|
6
6
|
end
|
7
7
|
|
8
8
|
def radio(attribute_name, options = {}, &block)
|
9
9
|
options[:wrapper] ||= :inline_radio
|
10
|
-
|
10
|
+
super
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module SimpleForm
|
2
|
-
class PlaceholderFormBuilder < SimpleForm::
|
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) ?
|
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.
|
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-
|
11
|
+
date: 2014-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-sass
|