Post to Layout's action instead of Page's action #9007
tomaszferens
started this conversation in
General
Replies: 1 comment
-
You can't. If you have an index route, Remix will always send it to the action in your index route because they both have the same URL. The only way to use the action in your layout is if the form itself is rendered in your layout and you use If you must use the action in your layout, I would recommend moving that logic to your index route, or create a resource route that you can explicitly call. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have following routes:
What I tried (Form was rendered in form.$form.tsx):
<Form method="POST">
posts toform_._index.tsx
<Form method="POST" action="/form">
posts toform_._index.tsx
<Form method="POST" action="/form/*">
posts toform.$form.tsx
How to post to the action declared in layout (form.tsx) when inside form.$form.tsx page?
Beta Was this translation helpful? Give feedback.
All reactions