<form accept-charset="UTF-8" action="/car" method="post">
...
</form>
It’s going to /car
regardless based on the action
set in the form element. It’s new.html.eex
that is reused.
From Programming Phoenix 1.4:
User Controller
https://media.pragprog.com/titles/phoenix14/code/ecto/listings/rumbl/lib/rumbl_web/controllers/user_controller.change3.ex
Note how new
renders with new.html
while create
renders with new.html
in case there is an error (in case of success it redirects to index
which renders with index.html
).
But your code does the same thing.