-
Notifications
You must be signed in to change notification settings - Fork 415
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
Duplicated component name inside stimulus controller when using sidecar option #1393
Comments
👍🏻 Makes sense to me. Want to write the PR? |
Correct me if I'm wrong, but that's the expected behavior: the Stimulus controller identifier depends on the path and file name of the controller JS file.
See https://stimulus.hotwired.dev/handbook/installing#controller-filenames-map-to-identifiers |
Yes you are right, the new name would work, but is better keep default naming from stimulus for the default imports. Maybe the better approach in my case is change the controller name from
|
You can use view_component-contrib or implement your own generator by copying this file in your project and adapting it. |
Thanks @Spone for the help! I will use view_component-contrib to generate my components |
Feature request
Improves stimulus controller name when we have sidecar option
Example
When i run
rails g component Reports::Footer::Card --sidecar --stimulus --preview
Its creates the html with component name duplicated in data-controller prop
But would be better to be:
The text was updated successfully, but these errors were encountered: