Open jakemumu opened 2 days ago
@jakemumu to fix that you have to create two layouts and two JavaScript entrypoints; One for Inertia and one for your normal rails views
@jakemumu to fix that you have to create two layouts and two JavaScript entrypoints; One for Inertia and one for your normal rails views
nice!!!
Is there any way for me to help with the project documentation? maybe there is a gotcha or FAQ? -- I would never have guessed that honestly -- wouldn't it be possible to make the library handle that?
For anyone that comes across this here is a solution which makes it possible to retain the same layout & entry point you're already using:
// detect if the data is on the page which indicates it's an inertia render
if (document.querySelector('[data-page]')) {
createInertiaApp({
resolve: name => import(`../frontend/${name}.svelte`),
setup({ el, App, props }) {
new App({ target: el, props });
},
});
}
Hi! Just getting setup with inertia and it's awesome -- I do notice this error though. I'm only planning to use inertia on some pages of my rails app -- but I initialize it on my entrypoint/application.js
When I hit a route which doesn't not render via inertia I get this crash from the initialization of inertia:
Is there a way to avoid this? -- I don't see a way at the moment