Skip to content
Discussion options

You must be logged in to vote

The way it's currently setup, clicking the button makes an XHR request:

However, the server responds with HTML, so nothing happens.

Instead of fetching the result, it sounds like you would want to navigate to that page. JS From Routes helpers provide a path method that you can use in links:

<li><a href={users.new.path()}>Sign Up</a></li>

After fixing a typo:

- import EmailPasswordForm from "./forms/EmailPasswordForm.svelte";
+ import EmailPasswordForm from "~/components/forms/EmailPasswordForm.svelte";

If you plan on using Svelte components as pages, I highly recommend that you check out Inertia, as it would enable client-side navigation without adding any boilerplate.

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@brennacodes
Comment options

Comment options

You must be logged in to vote
1 reply
@brennacodes
Comment options

Comment options

You must be logged in to vote
4 replies
@ElMassimo
Comment options

@brennacodes
Comment options

@planetaska
Comment options

@brennacodes
Comment options

Comment options

You must be logged in to vote
4 replies
@ElMassimo
Comment options

Answer selected by brennacodes
@brennacodes
Comment options

@planetaska
Comment options

@brennacodes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants