Docs: mention that controller references should be kebab-case on manual registration to avoid issues with targets#725
Open
stillhart wants to merge 1 commit intohotwired:mainfrom
Open
Docs: mention that controller references should be kebab-case on manual registration to avoid issues with targets#725stillhart wants to merge 1 commit intohotwired:mainfrom
stillhart wants to merge 1 commit intohotwired:mainfrom
Conversation
…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}
marcoroth
reviewed
Oct 17, 2023
| 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) |
Member
There was a problem hiding this comment.
What do you think, would it instead make sense to update the example above to include the kebab-case version?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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