Commit e6a66d0
committed
fix: replace broken chosen-rails gem with official Chosen v1.8.7 assets
## Problem
The chosen-rails gem's support-rails-8 branch has broken CoffeeScript
compilation that causes Chosen dropdowns to appear empty despite having
populated <option> elements in the DOM.
The CoffeeScript comprehension syntax was compiling to broken JavaScript
with uninitialized loop variables (`for (undefined; i < len; i++)`),
causing loops to never execute. This affected both option parsing and
DOM rendering.
## Root Cause
CoffeeScript 1.12.2 (from 2016) combined with the support-rails-8
branch produces incorrect JavaScript compilation for comprehension loops.
## Solution
Removed the chosen-rails gem dependency and replaced it with official
pre-compiled Chosen v1.8.7 assets in vendor/:
- vendor/assets/javascripts/chosen.jquery.js
- vendor/assets/stylesheets/chosen.css
- vendor/assets/images/chosen-sprite.png
- vendor/assets/images/chosen-sprite@2x.png
Updated application.js to require chosen.jquery from vendor instead of
the gem.
## Benefits
1. Avoids CoffeeScript compilation issues entirely
2. Removes unnecessary gem dependency
3. Full control over Chosen version
4. Simpler asset pipeline (no gem-based asset resolution)
## Additional Fixes
- Fixed JavaScript syntax error in application.js (chosen() options)
- Fixed script loading order (jQuery before Bootstrap)
- Added blank prompt option to members dropdown
## Testing
Verified working:
- Member directory dropdown (240 members)
- Search/filter functionality
- Keyboard navigation
- Single deselect option
## Future Consideration
This uses the jQuery-dependent Chosen library. Long-term, consider
replacing with a modern JavaScript alternative without jQuery dependency.1 parent f7328d9 commit e6a66d0
8 files changed
Lines changed: 1863 additions & 48 deletions
File tree
- app
- assets/javascripts
- views/admin/members
- vendor/assets
- images
- javascripts
- stylesheets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 9 | | |
20 | 10 | | |
21 | 11 | | |
| |||
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 157 | | |
175 | 158 | | |
176 | 159 | | |
| |||
184 | 167 | | |
185 | 168 | | |
186 | 169 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | 170 | | |
191 | 171 | | |
192 | 172 | | |
| |||
234 | 214 | | |
235 | 215 | | |
236 | 216 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | 217 | | |
250 | 218 | | |
251 | 219 | | |
| |||
548 | 516 | | |
549 | 517 | | |
550 | 518 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | 519 | | |
560 | 520 | | |
561 | 521 | | |
| |||
659 | 619 | | |
660 | 620 | | |
661 | 621 | | |
662 | | - | |
663 | 622 | | |
664 | 623 | | |
665 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
Loading
Loading
0 commit comments