From cbde446648589fb24320e835cfe959d32887f5ec Mon Sep 17 00:00:00 2001 From: Stillhart Date: Mon, 9 Oct 2023 12:31:01 +0000 Subject: [PATCH] add an explizit line that kebab-case should be used when manually registering controller in order to avoid issues further down then line with targets. Technically snake_case also works, but that results in an unpredicable target naming. especially in combination with the rails helper tag.div ... data: {foo_bar_target: :baz} --- docs/reference/controllers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/controllers.md b/docs/reference/controllers.md index 97023e23..0cc2de5a 100644 --- a/docs/reference/controllers.md +++ b/docs/reference/controllers.md @@ -138,6 +138,8 @@ import ReferenceController from "./controllers/reference_controller" application.register("reference", ReferenceController) ``` +Use kebab-case in references to ensure features like targets function correctly (i.e., controllers/date_picker_controller, DatePickerController, date-picker) + You can also register a controller class inline instead of importing it from a module: ```js