trenni-formatters 2.1.0 → 2.1.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: 3e9682ac41303a62dc948ed52b7d1bd597fb4c00
4
- data.tar.gz: 63cd6ecbc0b9ec56d552facc8db44658976af2c4
3
+ metadata.gz: 1036d2369c3b3bde480f8bad87942960ba4a7b22
4
+ data.tar.gz: e7d467c11f019cc49ae0e23a3383548d8673bcfc
5
5
  SHA512:
6
- metadata.gz: 4b293ddb4c76c73718f2a47a0450743dc12c2dfa75694e29076334489c79669f92e78e1caa1926c54c61481225aded63f7aea531f76923ccade6d582a2002eea
7
- data.tar.gz: 72987bad7488aa7c351cc83ed5577879b933d6178f27ac02e6648b15840fad41c02364909586063d0ad8be4cea4ecf6a688a5d89e07b2bd62c86f2ba51fbf780
6
+ metadata.gz: f7cc27f561472dd8c22148278484a73e58331a7efec5b13bd09cd0548b78bb93f56a0def9abdf632e5d790567c0dac6159d6280a0cd5fbf2bc3ccc92eecc664a
7
+ data.tar.gz: 1cfd277dafd6b61868df9893595c921a5de35eccbeb357f6e7b0947f276bbdb94c4ca804ab7b61df64d3f46118a99ff88b3e714f882c48517dcbe5535d04849a
@@ -34,6 +34,8 @@ module Trenni
34
34
  def initialize(formatter, options, builder)
35
35
  @formatter = formatter
36
36
  @object = formatter.object
37
+
38
+ @options = options
37
39
  @field = options[:field]
38
40
 
39
41
  @builder = builder
@@ -55,8 +57,9 @@ module Trenni
55
57
  return {
56
58
  :type => :radio,
57
59
  :name => @field,
58
- :value => value_for(options),
59
- :selected => options[:selected],
60
+ # We set a default value to empty string, otherwise it becomes "on".
61
+ :value => value_for(options) || "",
62
+ :checked => options.fetch(:selected){ value_for(@options) == value_for(options) },
60
63
  :data => options[:data],
61
64
  }
62
65
  end
@@ -67,7 +70,7 @@ module Trenni
67
70
  builder.inline(:td, :class => :handle) do
68
71
  builder.tag :input, radio_attributes_for(options)
69
72
  end
70
-
73
+
71
74
  builder.inline(:td, :class => :item) do
72
75
  if block_given?
73
76
  builder.append Trenni::Template.capture(self, &block)
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Trenni
22
22
  module Formatters
23
- VERSION = "2.1.0"
23
+ VERSION = "2.1.1"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trenni-formatters
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams