sdr_view_components 0.11.1 → 0.11.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9dbc7e428976b883ea16efc5d7f520859d1f91339da3e8c4c1972f058f048309
|
|
4
|
+
data.tar.gz: 3d28e043fc28c28001b6e1de79728b4e81204fb092ccc04cbed2e4b302c9b9b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f02a18b3d5a33250fb4bac47934887e85a5449c1c8fabb6bd02ef6c3111d37a88cdf93229238157d0eefffb6c9039f778ee039ac0853e21b57412243c5844d0d
|
|
7
|
+
data.tar.gz: 350cfee1326d362535d60fd2d8d07ab14370b60d9ce36204e38e1532919024e62a77f1af43ed258581285fae4bcb068666633e8c80648020d0738dc4b31552e7
|
|
@@ -15,14 +15,22 @@ module SdrViewComponents
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def label_field_name
|
|
18
|
-
"#{
|
|
18
|
+
"#{sanitize_method_name(field_name)}_#{sanitize_value(input_args[:value])}"
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
# The input is rendered by form.radio_button, so the label's for must match the id that
|
|
24
|
+
# ActionView::Helpers::Tags::Base generates. These mirror its sanitized_method_name and
|
|
25
|
+
# sanitized_value. Note this is *not* form_tag_helper.rb's sanitize_to_id, which applies
|
|
26
|
+
# to radio_button_tag and disagrees on uppercase letters, '.', and other non-word chars.
|
|
27
|
+
# From https://github.com/rails/rails/blob/main/actionview/lib/action_view/helpers/tags/base.rb
|
|
28
|
+
def sanitize_method_name(name)
|
|
29
|
+
name.to_s.delete_suffix('?')
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def sanitize_value(value)
|
|
33
|
+
value.to_s.gsub(/[\s.]/, '_').gsub(/[^-[[:word:]]]/, '').downcase
|
|
26
34
|
end
|
|
27
35
|
end
|
|
28
36
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sdr_view_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aaron Collier
|
|
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
375
375
|
- !ruby/object:Gem::Version
|
|
376
376
|
version: '0'
|
|
377
377
|
requirements: []
|
|
378
|
-
rubygems_version: 4.0.
|
|
378
|
+
rubygems_version: 4.0.6
|
|
379
379
|
specification_version: 4
|
|
380
380
|
summary: Rails gem for providing SDR-specific ViewComponents.
|
|
381
381
|
test_files: []
|