phlexi-form 0.5.4 → 0.5.6

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
  SHA256:
3
- metadata.gz: 6c0832db88c6c818befeb3eb29ab0c27cfd6283c6bb76356fe100d7b90cc4471
4
- data.tar.gz: 1567a41dbfb954ab71c4f47625955d95253c0af56340fa250a6e82fb651f26ef
3
+ metadata.gz: b9671f4f7fcb1593070bf2544eb6245cdcdf7fda5565a4596a0dd6a6849bc1e7
4
+ data.tar.gz: 541f135bab202a68032c4c77200fc8a9089db71fef4cab768b172f35bfd440e4
5
5
  SHA512:
6
- metadata.gz: 32645119292a9042dba8e9f8593377d8f75e58f02d423c47188331d43d695a6f950060aab0ed9b458bd6638c8b9d72b215e83d9ffc657ddbadb2f78d61bc8e71
7
- data.tar.gz: 8dc3b74c1d8c856c7b06599bb82e0d15a1649aec515ec855533073e3c86ea8ace4c177220b35f0be1d60c558a400c403d8bbddcb6debde7c5f01d4966ad18774
6
+ metadata.gz: 249664388de34b3295df4a9889088c1faa0ac5ba6a6405561798c40a1473f74e3c73fc61d5db4854d6acb49948064d214fd7a722f8d3d7af2253cf83f98c9717
7
+ data.tar.gz: 84956947661e1b7f8f69134bd08302a74f7af64544aed0c1d2bee95ddde8ff788015c5e1cb3496acae1c6bc841f273afef2b936de6e1bbb3ccc58dd189c08583
@@ -105,11 +105,11 @@ module Phlexi
105
105
  yield if block_given?
106
106
  end
107
107
 
108
- def extract_input(params)
108
+ def extract_input(params, view_context: nil)
109
109
  params = params.to_unsafe_h if params.respond_to?(:to_unsafe_h)
110
110
  params = {} unless params.is_a?(Hash)
111
111
 
112
- call unless @_rendered
112
+ call(view_context: view_context) unless @_rendered
113
113
  @namespace.extract_input(params)
114
114
  end
115
115
 
@@ -92,6 +92,10 @@ module Phlexi
92
92
  input_tag(type: :search, theme: :search, **, &)
93
93
  end
94
94
 
95
+ def hidden_input_tag(**, &)
96
+ input_tag(type: :hidden, theme: nil, **, &)
97
+ end
98
+ alias_method :hidden_tag, :hidden_input_tag
95
99
  # Creates a checkbox tag for the field.
96
100
  #
97
101
  # @param attributes [Hash] Additional attributes for the checkbox.
@@ -10,7 +10,9 @@ module Phlexi
10
10
  namespace = build_namespace(0)
11
11
  @block.call(namespace)
12
12
 
13
- inputs = params[key].map { |param| namespace.extract_input([param]) }
13
+ params = params[key]
14
+ params = params.values if params.is_a?(Hash)
15
+ inputs = params.map { |param| namespace.extract_input([param]) }
14
16
  {key => inputs}
15
17
  end
16
18
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Phlexi
4
4
  module Form
5
- VERSION = "0.5.4"
5
+ VERSION = "0.5.6"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phlexi-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-29 00:00:00.000000000 Z
11
+ date: 2024-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex