simple_form_bootstrap3 0.3.0 → 0.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f26fd475c7f606bc38cd404177953a1537174c7e
|
4
|
+
data.tar.gz: af2e59a3ee3e87daf94c2d6246a6bc9ee8066d68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0425e448ee9940b67b2c3d842ae919c47e0ff027708ca28bad5d5bb396f20b5dde51bd2fde9604832f6e368ae5de342f3cb8fe98312558ce93f8151ba1ac6f83
|
7
|
+
data.tar.gz: 4bd5ca0bf084e76b24057f7baf3679da8c824de582ec7fc59ef1316c3cf68fa3243328944f28f52b2b5ae3e145256d1620d2a10a2aaff43a36807758444a9148
|
@@ -8,7 +8,9 @@ module SimpleForm
|
|
8
8
|
private
|
9
9
|
|
10
10
|
def input_html_options
|
11
|
-
if options.key? :value
|
11
|
+
if options.key?(:input_html) && options[:input_html].key?(:value)
|
12
|
+
value = options[:input_html][:value]
|
13
|
+
elsif options.key? :value
|
12
14
|
value = options[:value]
|
13
15
|
elsif object.respond_to?(attribute_name)
|
14
16
|
value = object.send(attribute_name)
|
@@ -19,7 +21,13 @@ module SimpleForm
|
|
19
21
|
value = Time.zone.parse(value) if value.is_a?(String)
|
20
22
|
value = value.strftime("%Y-%m-%d") if value.respond_to?(:strftime)
|
21
23
|
|
22
|
-
{ class: 'form-control text-center date datepicker', value: value.presence || '' }
|
24
|
+
result = { class: 'form-control text-center date datepicker', value: value.presence || '' }
|
25
|
+
if options.key? :input_html
|
26
|
+
result[:class] += ' ' + options[:input_html][:class] if options[:input_html][:class].present?
|
27
|
+
result.merge(options[:input_html].except(:class, :value))
|
28
|
+
else
|
29
|
+
result
|
30
|
+
end
|
23
31
|
end
|
24
32
|
end
|
25
33
|
end
|
@@ -8,7 +8,9 @@ module SimpleForm
|
|
8
8
|
private
|
9
9
|
|
10
10
|
def input_html_options
|
11
|
-
if options.key? :value
|
11
|
+
if options.key?(:input_html) && options[:input_html].key?(:value)
|
12
|
+
value = options[:input_html][:value]
|
13
|
+
elsif options.key? :value
|
12
14
|
value = options[:value]
|
13
15
|
elsif object.respond_to?(attribute_name)
|
14
16
|
value = object.send(attribute_name)
|
@@ -19,7 +21,13 @@ module SimpleForm
|
|
19
21
|
value = Time.zone.parse(value) if value.is_a?(String)
|
20
22
|
value = value.strftime("%Y-%m-%d %H:%M") if value.respond_to?(:strftime)
|
21
23
|
|
22
|
-
{ class: 'form-control text-center datetime datetimepicker', value: value.presence || '' }
|
24
|
+
result = { class: 'form-control text-center datetime datetimepicker', value: value.presence || '' }
|
25
|
+
if options.key? :input_html
|
26
|
+
result[:class] += ' ' + options[:input_html][:class] if options[:input_html][:class].present?
|
27
|
+
result.merge(options[:input_html].except(:class, :value))
|
28
|
+
else
|
29
|
+
result
|
30
|
+
end
|
23
31
|
end
|
24
32
|
end
|
25
33
|
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.3.
|
4
|
+
version: 0.3.1
|
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-09-
|
11
|
+
date: 2014-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-sass
|