pxs-forms 0.1.1 → 0.1.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: f882bf75ec6ef1fa8258aac92f9aab8766a2c5a9522340b4c69d8c601fc07df5
4
- data.tar.gz: 1807072c6f54b2cef4739569c825e61fca4b775955c641a7f8a5dd71ea8e6e2e
3
+ metadata.gz: 981f2859bcb9b331063ac4dae5aaba3c95265e783b07b8d37b39599aaba639ed
4
+ data.tar.gz: 81befc04467b8c087dc4aad8617d6008686fb812be54c4cbc1ebce7e582ce3bf
5
5
  SHA512:
6
- metadata.gz: f826272e261aba37f2c8dcf133c04a741f6144b13e58d40b9a542782e559484fb253db425f1dcc477a70730f8200c54ad651e9cf5fd1488c68040274b6b04809
7
- data.tar.gz: 798c44d36089f05471e182222acb21e37c14f0558deac3af84be12c82f79cc1df63c59c546686d2f94ff0234d2e917a6b788bfad82133e4c049a8bcc2b597d89
6
+ metadata.gz: dcfe9e12c264106324a7f83c149783a734d2236165461e808e0885f83cb2c7de63c010240e50b064e7248adf2da1a2e12fcdc2972d67d366d7d7c23ad1a0e4c8
7
+ data.tar.gz: 30aec3cb45e6393b39f96a3fe9f3bb5ea342ceb784d4a76b94ce837edbd908b3a6a6972cdc8613f8ecddb13f19205960cfa01ebf4e2a876db571d97cfa17282f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # pxs-forms
2
+
3
+ ## Unofficial Release
4
+
5
+ ## [0.1.2] - 2025-03-09
6
+
7
+ - Fix Multiple Selects not selecting the correct values
8
+
9
+ ## [0.1.1] - 2025-03-08
10
+
11
+ - Fix a bug where empty values are ignored when explicitly specified
12
+
13
+ ## [0.1.0]
14
+
15
+ - Mostly bug-free release, testing needs to be done
16
+
1
17
  ## [Unreleased]
2
18
 
3
19
  ## [0.0.1] - 2024-03-20
@@ -16,4 +32,4 @@
16
32
  - Use base input names and IDs in model form builder
17
33
  - Add select or create subform as a model form builder method
18
34
  - Add nested association form and related methods to models helper
19
- - Add shorthand methods: model_form_for, model_form_with
35
+ - Add shorthand methods: model_form_for, model_form_wit
@@ -241,10 +241,11 @@ class ModelFormBuilder < ActionView::Helpers::FormBuilder
241
241
  input_options = options || {}
242
242
 
243
243
  multiple = input_options[:multiple]
244
+ selected = if object.respond_to? attribute then object.send(attribute) else object[attribute] end
244
245
 
245
246
  safe_join [
246
247
  collection_input(attribute, options) do
247
- @template.collection_select(object.class.model_name.singular.to_sym, attribute, options[:collection], value_method, text_method, {selected: object[attribute]}.merge(options[:select] || {}), merge_input_options({class: "#{"custom-select" unless multiple} #{"is-invalid" if has_error?(attribute)}"}, options[:input_html]))
248
+ @template.collection_select(object.class.model_name.singular.to_sym, attribute, options[:collection], value_method, text_method, {selected:}.merge(options[:select] || {}), merge_input_options({class: "#{"custom-select" unless multiple} #{"is-invalid" if has_error?(attribute)}"}, options[:input_html]))
248
249
  end
249
250
  ]
250
251
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pxs
4
4
  module Forms
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxs-forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Poubelle