template_form 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db33072169a06cf9c413c7344703d7f0ecec5a370e837e3d3fe3b75f72af3db4
4
- data.tar.gz: 8eab8b70bae6bf35de91d7de20400381fb10512a05e0687fca726b784e3ecbf4
3
+ metadata.gz: 831afd10695d17fed79e6a62a3ea6ecb2c51bcc437b65575d0f0779dfa55f922
4
+ data.tar.gz: 2973a09954d830e56832cea3acd70c365cfcd7f395292f29e7b2d81b6defb247
5
5
  SHA512:
6
- metadata.gz: 4b49e409abf1686d12586aa8aa2b4f709a6feb36a888f6cd00f26d7577702a26aad076dc606ff7e4363f4e9ed3fb8fe550eb379ea72137c4ba729c5d7f794322
7
- data.tar.gz: 438cb38f9938e9787efbc5d47da96d1aad7c554268f659c819752122cdad6ae85f2b356fcea62999b36a8e86dd6c670c872822396833bdbafdccb8b98f10fb74
6
+ metadata.gz: bb73aa0f7cfe2402e1b2515396f3553de092c76a9f50330fed9b4c9f2ebc2fadb2ba72d759954d6a54b12bd203ff2227f4199ba8a05e234eeecf58113c4ca837
7
+ data.tar.gz: f280f82dce862022e1663a1d7ce981a285c35776dd6e6c0b952e0de361ce70325f0bbe8312df435e8318cc37a11c77662d2b8c06d805e3e1fc79b5715bc201e4
@@ -28,9 +28,8 @@ module TemplateForm
28
28
 
29
29
  data_attributes = (options.delete(:data) || {}).transform_keys { |k| "data-#{k}" }
30
30
 
31
- @options = options.select { |k,_| OPTION_KEYS.include? k }
31
+ @options, @html_options = options.partition { |k,_| OPTION_KEYS.include? k }.map(&:to_h)
32
32
 
33
- @html_options = options.reject { |k,_| OPTION_KEYS.include? k }
34
33
  @html_options.merge! data_attributes
35
34
  @html_options[:class] ||= ''
36
35
  end
@@ -26,9 +26,8 @@ module TemplateForm
26
26
 
27
27
  data_attributes = (options.delete(:data) || {}).transform_keys { |k| "data-#{k}" }
28
28
 
29
- @options = options.select { |k,_| OPTION_KEYS.include? k }
29
+ @options, @html_options = options.partition { |k,_| OPTION_KEYS.include? k }.map(&:to_h)
30
30
 
31
- @html_options = options.reject { |k,_| OPTION_KEYS.include? k }
32
31
  @html_options.merge! data_attributes
33
32
  @html_options[:class] ||= ''
34
33
  end
@@ -6,7 +6,7 @@
6
6
  <%= label attribute_name, label_text, label_options %>
7
7
  <% end %>
8
8
 
9
- <div class="control <%= options.delete(:control_class) %>">
9
+ <div class="control <%= html_options.delete(:control_class) %>">
10
10
  <%- html_options[:class] << ' select' %>
11
11
  <%- html_options[:class] << ' is-danger' if errors[attribute_name].present? %>
12
12
  <div class="<%= html_options[:class] %>">
@@ -9,8 +9,8 @@
9
9
  <% end %>
10
10
 
11
11
  <div class="field-body">
12
- <div class="field <%= options.delete(:field_body_field_class) %>">
13
- <div class="control <%= options.delete(:control_class) %>">
12
+ <div class="field <%= html_options.delete(:field_body_field_class) %>">
13
+ <div class="control <%= html_options.delete(:control_class) %>">
14
14
  <%- html_options[:class] << ' select' %>
15
15
  <%- html_options[:class] << ' is-danger' if errors[attribute_name].present? %>
16
16
  <div class="<%= html_options[:class] %>">
@@ -9,8 +9,8 @@
9
9
  <% end %>
10
10
 
11
11
  <div class="field-body">
12
- <div class="field <%= options.delete(:field_body_field_class) %>">
13
- <div class="control <%= options.delete(:control_class) %>">
12
+ <div class="field <%= html_options.delete(:field_body_field_class) %>">
13
+ <div class="control <%= html_options.delete(:control_class) %>">
14
14
  <%- html_options[:class] << ' select' %>
15
15
  <%- html_options[:class] << ' is-danger' if errors[attribute_name].present? %>
16
16
  <div class="<%= html_options[:class] %>">
@@ -1,3 +1,3 @@
1
1
  module TemplateForm
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: template_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-15 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack