Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: mention that controller references should be kebab-case on manual registration to avoid issues with targets #725

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stillhart
Copy link

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 unpredictable target naming. Especially in combination with the rails helper tag.div ... data: {foo_bar_target: :baz}

https://discord.com/channels/988103760050012160/1044659701213835294/1160906429109125240

…istering 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}
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think, would it instead make sense to update the example above to include the kebab-case version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants