Exercise: Remix Actions
Our last exercise! Let's get a couple actions created!
Under exercise/remix-actions
there are starter files. Two routes exist, one
for a machines list and one for creating machines. You have markup ready for
you. Your task is to make those pages functional!
-
Under
routes/machines.create.tsx
add an action that takes thename
andmodel
from the form. Create a machine through themachine model
and thenredirect
to the/machines
route. Your new machine should appear! -
Under
routes/machines
add a delete button to each machine list item. It should call an action to delete the machine, but we stay on the same page!