Closed DeedleFake closed 1 year ago
I don't believe this is achievable with Inertia. Although Inertia allows us to manage the entire page with Svelte, it doesn't provide the capability to handle just a single component inside an erb page
Yeah, Inertia is meant to replace the Rails view layer, not to integrate within it.
I work in React, and if I needed an ERB template driven application with some interactive sprinkles in it I'd reach for a different solution than Inertia.js.
Ah well. Thankfully, I only need it for some internal pages that aren't user-facing, so I can just keep using `WebpackerSvelte for those, I guess. Just means that they won't get any SSR, but that's fine.
Only want to comment that I have the same "issue" as @DeedleFake!
Converting an existing Rails + Vue app into one using inertia, some pages aren't just Vue components but ActionView pages with a vue component embedded in them.
As a workaround for those I kept my old createApp
configuration but it only runs if it can't find the #app
inertia component.
I'm also curious as to why render inertia
is not available in erb
I have recently switched from WebpackerSvelte to Inertia.js for using Svelte components with a Rails backend, but one feature I don't seem to be able to replicate is the ability to render a Svelte component into the middle of an ERB template. With WebpackerSvelte, I was able to do something like
and it would just work, but inertia-rails doesn't seem to work for that. Am I missing something, or is there no way to do this?