[Bug Fix] Fix /docs/dropdown_menu 404 (#428)
Merged
DJ
5mo ago+5+5+0123456789-2-2-0123456789
Fixes #428 — /docs/dropdown_menu returned a 404.
Root cause
Two stacked problems:
- Broken docs example. The "Non-navigational item" example added in #427 referenced a
DialogClosecomponent that does not exist in the gem.VisualCodeExampleevaluates the snippet at render time (instance_eval), so it raisedNoMethodError: undefined method 'DialogClose'and the page failed to render. - Error masking.
config.exceptions_appwas a lambda that always rendered thenot_foundaction, so the resulting 500 surfaced as a 404 page — hiding the real error and making the issue look like a missing route.
Changes
docs/app/views/docs/dropdown_menu.rb— close the dialog with the documented pattern (Buttonwired toclick->ruby-ui--dialog#dismiss, the same approach used indialog_docs.rb) instead of the nonexistentDialogClose.docs/config/application.rb— pointexceptions_appat the router. The/404and/500routes already exist, so the response status now matches the actual error andErrorsController#internal_server_errorbecomes reachable. This un-masks future 500s.
Verification
- Live (docker):
/docs/dropdown_menu→ 200, renders clean. Exercised the example in-browser — dropdown opens, "Delete" item opens the Dialog, the Delete button dismisses it. bin/rails test→ 70 runs, 0 failures.standardrbclean.
Note on search (⌘K)
Investigated the reported search issue too: production search works (verified in-browser — click opens the command dialog and focuses the input). The local breakage was a stale, gitignored asset build predating the command-dialog controller; rebuilding assets fixes it. No code change needed, so nothing for it here.
Summary by cubic
Fixes the /docs/dropdown_menu 404 by correcting the docs example and routing exceptions through the Rails router so real 500s aren’t masked as 404s.
- Bug Fixes
- Replaced nonexistent
DialogClosein the “Non‑navigational item” example with aButtonwired toclick->ruby-ui--dialog#dismiss. - Set
config.exceptions_app = routesso/404and/500handle errors and status codes reflect the actual failure.
- Replaced nonexistent