tam_select 0.1.1 → 1.0.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -3
  3. data/lib/tam_select/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3a066f1e145b6a880f28494f78c00d51c1ca280fc984975c2eebf849704041c
4
- data.tar.gz: 1537eeda1e3dda9a3a38077bbfe6076cc9d851e6b404345188b61b845fd3107a
3
+ metadata.gz: e3f063f1d79268f900b10c4b86399cba1a34dac0154a90c4c12fd505771a1431
4
+ data.tar.gz: 0cf4fe7a1cf1d1dc479065318819db1ced4e71888e81e6c98a25fc6920841852
5
5
  SHA512:
6
- metadata.gz: 454ff7b7e777da2409741dff572ead04fc84ae5e65be2984c44d9c0196924ecf6d695e7445d23cbb7ba683abea8bf7e821f79e06cac71da9e4c8c6a718f8c823
7
- data.tar.gz: f5950761f9e589454f4dad82e2ed52dbe5ac88d5856a8ee133da81916bf5e5ec20c8e434e23aca8a868b8d9cce4612d5926929e1ef4643e9c4d597541c3b943e
6
+ metadata.gz: 8ad40f38121d3e83e9260c825c8bbd7546c62d87073fef14ef63c70fd027a1a08bcbd18d51d60198d3a06410b2e3c3ffd325182f99b9b08c1af7b23e725a70c3
7
+ data.tar.gz: 55469f46c8348ed51dff78070efe3ddf8b95ce43cb2ae3d5b299382bf80437022fe1f91066e07c2b4d061abfba0c984d892d958616692a02415c062e4cb622db
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
- # Tam Select
1
+ the # Tam Select
2
2
 
3
3
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+ [![Gem Version](https://img.shields.io/badge/version-0.1.1-blue.svg)](https://github.com/tamiru/tam_select)
4
5
 
5
6
  **Tam Select** is an accessible, searchable select component for Ruby on Rails, built for Simple Form, Stimulus, Turbo, and Tailwind CSS. It keeps the native `<select>` as the source of truth, so Rails form submission, validation, selected values, and browser autofill continue to work.
6
7
 
@@ -48,6 +49,23 @@ Add the generated JavaScript to Tailwind's source detection in `app/assets/tailw
48
49
  @source "../../javascript/tam_select/**/*.js";
49
50
  ```
50
51
 
52
+ ### Updating
53
+
54
+ The Rails integration files are copied into your application, so updating the gem does not update them automatically. Commit local customizations first, then run:
55
+
56
+ ```bash
57
+ bundle update tam_select
58
+ bin/rails generate tam_select:install
59
+ ```
60
+
61
+ Rails prompts before replacing changed files. To replace every generated file without prompting, use:
62
+
63
+ ```bash
64
+ bin/rails generate tam_select:install --force
65
+ ```
66
+
67
+ Review `git diff` afterward because `--force` overwrites application-specific customizations.
68
+
51
69
  ## Features
52
70
 
53
71
  - Single and multiple selection
@@ -124,7 +142,7 @@ The install generator creates `app/inputs/tam_select_input.rb`. Use it like any
124
142
  prompt: "Select region",
125
143
  input_html: {
126
144
  tam_options: {
127
- remoteUrl: regions_path,
145
+ remoteUrl: region_options_path(format: :json),
128
146
  minQueryLength: 1
129
147
  }
130
148
  } %>
@@ -187,7 +205,7 @@ get "region_options", to: "region_options#index", defaults: { format: :json }
187
205
  value_method: :id,
188
206
  input_html: {
189
207
  tam_options: {
190
- remoteUrl: region_options_path,
208
+ remoteUrl: region_options_path(format: :json),
191
209
  minQueryLength: 1
192
210
  }
193
211
  } %>
@@ -195,6 +213,22 @@ get "region_options", to: "region_options#index", defaults: { format: :json }
195
213
 
196
214
  Do not accept a model name from request parameters. Declaring each source in a controller subclass prevents clients from querying arbitrary application models.
197
215
 
216
+ The browser sends requests such as:
217
+
218
+ ```text
219
+ GET /region_options.json?q=addis&page=1
220
+ Accept: application/json
221
+ ```
222
+
223
+ Test an endpoint independently with:
224
+
225
+ ```bash
226
+ curl -H "Accept: application/json" \
227
+ "http://localhost:3000/region_options.json?q=addis&page=1"
228
+ ```
229
+
230
+ A `406 Not Acceptable` response means the route or controller rejected JSON. Keep `defaults: { format: :json }` on the route, use a `.json` URL, and ensure the controller does not restrict responses to HTML only.
231
+
198
232
  ## Core JavaScript
199
233
 
200
234
  ```js
@@ -1,3 +1,3 @@
1
1
  module TamSelect
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tam_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tamiru Hailu