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: 5afdcffa73cffd6dfe2ac65b329e078a872da623
4
- data.tar.gz: 448595ce076d075240039433902003eb983a4aac
3
+ metadata.gz: f26fd475c7f606bc38cd404177953a1537174c7e
4
+ data.tar.gz: af2e59a3ee3e87daf94c2d6246a6bc9ee8066d68
5
5
  SHA512:
6
- metadata.gz: a37376a8b87ef80954a6a9d4c6e763f7d57a4596ce0d788f7f1808413a047230c3cee41e9c9c82f2a844c8379b658853942a8b665fc3e283cf9fa6eb5a3a4b4b
7
- data.tar.gz: 7687021a39cd83d796e17b25af3112baea47f91b2c9acaa96c61c75da29e1aa11709649026b1d7145bfd9bd90ba3f98a7d3c41ff53b42da32e27cc0ae7ab002f
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
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBootstrap3
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
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.3.0
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-03 00:00:00.000000000 Z
11
+ date: 2014-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-sass