inertia-rails icon indicating copy to clipboard operation
inertia-rails copied to clipboard

Proper case components will not render

Open matthewblott opened this issue 1 year ago • 2 comments

Like React, the convention for Svelte components is to use proper case (LikeThis) but Rails expects the default paths to be lowercase. It works (so far) if I change it to lowercase but I can see issues going forward and there should be a way to accept components named conventionally.

Below is a screenshot of what I had to do to get the show method to work - either use the more explicit render method with a named path as the first argument or change the .svelte file to lowercase:

Screenshot 2023-10-23 at 17 07 16

matthewblott avatar Oct 23 '23 16:10 matthewblott

Hmm.. I'm not sure we could enable both naming patterns without some heavy handed checks at runtime.

Maybe we could enable this via a setting? Would that solve the issue here?

BrandonShar avatar Oct 23 '23 16:10 BrandonShar

Hi @BrandonShar thanks for the prompt response. Being able to set this somewhere like the base controller should be fine. Every major front end framework uses proper case, I'm surprised it's not come up already.

matthewblott avatar Oct 23 '23 17:10 matthewblott