template_form 0.5.0 → 0.6.0

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: 0b6cc4d9623f0173a4237d5ed8dde6cd97eae075ee9f32515f7b918ffc3d3519
4
- data.tar.gz: a19f342f83d2618455a13768096da610d1938ecdfafdb4c6ff17eba3343d932e
3
+ metadata.gz: 6c834dd74c152f64f6433f9756b73f0ba4d21cc6690b65220356e0d5489b403c
4
+ data.tar.gz: e56aad9eb7633151f4e77624e60d231f4cc982f1670c6d3dfbf3b9d6900f57be
5
5
  SHA512:
6
- metadata.gz: 7f276ed7c3c9dfba1922f3d61b76b31f7aad2480802c182abaad480cb82678b45640c4337aa8484340a66ba49939d46cee358276d23131a1565d5f652e0343ad
7
- data.tar.gz: 8eb61ff35c92ecca35d05b69690765b7e1da03a2200f5227d5b8d029e6278a3d1941bfa46efe9c9be205c175ae3ebf0d566549549491e02b633494b7510f6617
6
+ metadata.gz: 0da4c675cad3277a0ad7f0be48ea54ccad334c9674ea7b8c89b44b0285390fb104e07954ae55e8599f25c69b2c4d330c63de3290d61fa3e2478988f439316ede
7
+ data.tar.gz: ffb95977b0d992787746bf52e9a29d8f0ab51c2bb5f3c6233f50c606de08aff0b0d62a1d7aaab09ecb48722c11e14cd9477e7f43444d954ab10028f0d16a7f97
@@ -1,15 +1,12 @@
1
- <div class="field <%= html_options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", html_options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <%- label_options[:class] << ' label' %>
5
- <%- label_options[:class] << ' required' if html_options.delete(:required) %>
4
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => html_options.delete(:required)) %>
6
5
  <%= label attribute_name, label_text, label_options %>
7
6
  <% end %>
8
7
 
9
- <div class="control <%= html_options.delete(:control_class) %>">
10
- <%- html_options[:class] << ' select' %>
11
- <%- html_options[:class] << ' is-danger' if errors[attribute_name].present? %>
12
- <div class="<%= html_options[:class] %>">
8
+ <div class="<%= view.class_names("control", html_options.delete(:control_class)) %>">
9
+ <div class="<%= view.class_names(html_options[:class], "select", "is-danger" => errors[attribute_name].present?) %>">
13
10
  <%= collection_select(
14
11
  attribute_name,
15
12
  collection,
@@ -1,14 +1,12 @@
1
- <div class="field <%= options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <%- label_options[:class] << ' label' %>
5
- <%- label_options[:class] << ' required' if options.delete(:required) %>
4
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => options.delete(:required)) %>
6
5
  <%= label attribute_name, label_text, label_options %>
7
6
  <% end %>
8
7
 
9
- <div class="control <%= options.delete(:control_class) %>">
10
- <%- options[:class] << ' input' %>
11
- <%- options[:class] << ' is-danger' if errors[attribute_name].present? %>
8
+ <div class="<%= view.class_names("control", options.delete(:control_class)) %>">
9
+ <%- options[:class] = view.class_names(options[:class], "input", "is-danger" => errors[attribute_name].present?) %>
12
10
  <%= text_field attribute_name, options %>
13
11
  </div>
14
12
 
@@ -1,14 +1,12 @@
1
- <div class="field <%= options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <%- label_options[:class] << ' label' %>
5
- <%- label_options[:class] << ' required' if options.delete(:required) %>
4
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => options.delete(:required)) %>
6
5
  <%= label attribute_name, label_text, label_options %>
7
6
  <% end %>
8
7
 
9
8
  <div class="control">
10
- <%- options[:class] << ' textarea' %>
11
- <%- options[:class] << ' is-danger' if errors[attribute_name].present? %>
9
+ <%- options[:class] = view.class_names(options[:class], "textarea", "is-danger" => errors[attribute_name].present?) %>
12
10
  <%= text_area attribute_name, options %>
13
11
  </div>
14
12
 
@@ -1,16 +1,15 @@
1
- <div class="field is-horizontal <%= options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", "is-horizontal", options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
4
  <div class="field-label">
5
- <%- label_options[:class] << ' label' %>
6
- <%- label_options[:class] << ' required' if options.delete(:required) %>
5
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => options.delete(:required)) %>
7
6
  <%= label attribute_name, label_text, label_options %>
8
7
  </div>
9
8
  <% end %>
10
9
 
11
10
  <div class="field-body">
12
11
  <div class="field">
13
- <div class="control <%= options.delete(:control_class) %>">
12
+ <div class="<%= view.class_names("control", options.delete(:control_class)) %>">
14
13
  <label class="checkbox">
15
14
  <%= check_box attribute_name, options %>
16
15
  </label>
@@ -1,9 +1,8 @@
1
- <div class="field is-horizontal <%= options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", "is-horizontal", options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <div class="field-label <%= options.delete(:field_label_class) || 'is-normal' %>">
5
- <%- label_options[:class] << ' label' %>
6
- <%- label_options[:class] << ' required' if options.delete(:required) %>
4
+ <div class="<%= view.class_names("field-label", options.delete(:field_label_class) { "is-normal" }) %>">
5
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => options.delete(:required)) %>
7
6
  <%= label attribute_name, label_text, label_options %>
8
7
  </div>
9
8
  <% end %>
@@ -15,9 +14,8 @@
15
14
  https://github.com/jgthms/bulma/issues/640#issuecomment-415231212
16
15
  %>
17
16
  <div class="field">
18
- <div class="control <%= options.delete(:control_class) %>">
19
- <%- options[:class] << ' input' %>
20
- <%- options[:class] << ' is-danger' if errors[attribute_name].present? %>
17
+ <div class="<%= view.class_names("control", options.delete(:control_class)) %>">
18
+ <%- options[:class] = view.class_names(options[:class], "input", "is-danger" => errors[attribute_name].present?) %>
21
19
  <%= text_field attribute_name, options %>
22
20
  </div>
23
21
 
@@ -1,19 +1,16 @@
1
- <div class="field is-horizontal <%= html_options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", "is-horizontal", html_options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <div class="field-label <%= html_options.delete(:field_label_class) || 'is-normal' %>">
5
- <%- label_options[:class] << ' label' %>
6
- <%- label_options[:class] << ' required' if html_options.delete(:required) %>
4
+ <div class="<%= view.class_names("field-label", html_options.delete(:field_label_class) { "is-normal" }) %>">
5
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => html_options.delete(:required)) %>
7
6
  <%= label attribute_name, label_text, label_options %>
8
7
  </div>
9
8
  <% end %>
10
9
 
11
10
  <div class="field-body">
12
- <div class="field <%= html_options.delete(:field_body_field_class) %>">
13
- <div class="control <%= html_options.delete(:control_class) %>">
14
- <%- html_options[:class] << ' select' %>
15
- <%- html_options[:class] << ' is-danger' if errors[attribute_name].present? %>
16
- <div class="<%= html_options[:class] %>">
11
+ <div class="<%= view.class_names("field", html_options.delete(:field_body_field_class)) %>">
12
+ <div class="<%= view.class_names("control", html_options.delete(:control_class)) %>">
13
+ <div class="<%= view.class_names(html_options[:class], "select", "is-danger" => errors[attribute_name].present?) %>">
17
14
  <%= grouped_collection_select(
18
15
  attribute_name,
19
16
  collection,
@@ -1,19 +1,16 @@
1
- <div class="field is-horizontal <%= html_options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", "is-horizontal", html_options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <div class="field-label <%= html_options.delete(:field_label_class) || 'is-normal' %>">
5
- <%- label_options[:class] << ' label' %>
6
- <%- label_options[:class] << ' required' if html_options.delete(:required) %>
4
+ <div class="<%= view.class_names("field-label", html_options.delete(:field_label_class) { "is-normal" }) %>">
5
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => html_options.delete(:required)) %>
7
6
  <%= label attribute_name, label_text, label_options %>
8
7
  </div>
9
8
  <% end %>
10
9
 
11
10
  <div class="field-body">
12
- <div class="field <%= html_options.delete(:field_body_field_class) %>">
13
- <div class="control <%= html_options.delete(:control_class) %>">
14
- <%- html_options[:class] << ' select' %>
15
- <%- html_options[:class] << ' is-danger' if errors[attribute_name].present? %>
16
- <div class="<%= html_options[:class] %>">
11
+ <div class="<%= view.class_names("field", html_options.delete(:field_body_field_class)) %>">
12
+ <div class="<%= view.class_names("control", html_options.delete(:control_class)) %>">
13
+ <div class="<%= view.class_names(html_options[:class], "select", "is-danger" => errors[attribute_name].present?) %>">
17
14
  <%= collection_select(
18
15
  attribute_name,
19
16
  collection,
@@ -1,18 +1,16 @@
1
- <div class="field is-horizontal <%= options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", "is-horizontal", options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <div class="field-label <%= options.delete(:field_label_class) || 'is-normal' %>">
5
- <%- label_options[:class] << ' label' %>
6
- <%- label_options[:class] << ' required' if options.delete(:required) %>
4
+ <div class="<%= view.class_names("field-label", options.delete(:field_label_class) { "is-normal" }) %>">
5
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => options.delete(:required)) %>
7
6
  <%= label attribute_name, label_text, label_options %>
8
7
  </div>
9
8
  <% end %>
10
9
 
11
10
  <div class="field-body">
12
11
  <div class="field">
13
- <div class="control <%= options.delete(:control_class) %>">
14
- <%- options[:class] << ' input' %>
15
- <%- options[:class] << ' is-danger' if errors[attribute_name].present? %>
12
+ <div class="<%= view.class_names("control", options.delete(:control_class)) %>">
13
+ <%- options[:class] = view.class_names(options[:class], "input", "is-danger" => errors[attribute_name].present?) %>
16
14
  <%= text_field attribute_name, options %>
17
15
  </div>
18
16
 
@@ -1,18 +1,16 @@
1
- <div class="field is-horizontal <%= options.delete(:field_class) %>">
1
+ <div class="<%= view.class_names("field", "is-horizontal", options.delete(:field_class)) %>">
2
2
 
3
3
  <% if has_label %>
4
- <div class="field-label <%= options.delete(:field_label_class) || 'is-normal' %>">
5
- <%- label_options[:class] << ' label' %>
6
- <%- label_options[:class] << ' required' if options.delete(:required) %>
4
+ <div class="<%= view.class_names("field-label", options.delete(:field_label_class) { "is-normal" }) %>">
5
+ <%- label_options[:class] = view.class_names(label_options[:class], "label", "required" => options.delete(:required)) %>
7
6
  <%= label attribute_name, label_text, label_options %>
8
7
  </div>
9
8
  <% end %>
10
9
 
11
10
  <div class="field-body">
12
11
  <div class="field">
13
- <div class="control <%= options.delete(:control_class) %>">
14
- <%- options[:class] << ' textarea' %>
15
- <%- options[:class] << ' is-danger' if errors[attribute_name].present? %>
12
+ <div class="<%= view.class_names("control", options.delete(:control_class)) %>">
13
+ <%- options[:class] = view.class_names(options[:class], "textarea", "is-danger" => errors[attribute_name].present?) %>
16
14
  <%= text_area attribute_name, options %>
17
15
  </div>
18
16
 
@@ -1,3 +1,3 @@
1
1
  module TemplateForm
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_dependency 'actionpack', '> 5.0'
24
+ spec.add_dependency 'actionpack', '>= 6.1.0'
25
25
  spec.add_dependency 'tilt', '~> 2.0'
26
26
 
27
27
  spec.add_development_dependency "bundler"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: template_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-29 00:00:00.000000000 Z
11
+ date: 2026-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: 6.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: 6.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tilt
29
29
  requirement: !ruby/object:Gem::Requirement