Sometimes I wonder why we can’t have a standard for something like server side rendered single file components/pages in rails. Here are some frontend inspirations:
Often I think why we always need to split html, css, js, i18n into that many files, and then having to reference each other. Rails already removes a lot of this reference pain, but not all of it.
I could imagine something like this, but of course a lot more refined:
What your opinion on single file components? I think it would increase the chance of code duplication while introducing an easy way to handle edge cases easier. An easy version could be implemented using
content_for() but I think that would be too limited.
Generally I would like to achieve more simplicity and not complexity, in this case by grouping all required code as much as possible.