- Send form via POST request with jQuery.
- Create resources from an AJAX POST.
- Render and consume JSON responses for created resources.
In this lab, we're going to continue to enhance our product and order system, this time updating the product creation page to create and display new products without requiring a refresh or redirect.
The solution for the previous lab has been included for you.
- Update the
new
product page to submit the form via AJAX POST. - Update the product
create
action to render a JSON representation of the product after successfully creating it. - Display the product details of the newly created product on the
new
page without refreshing or redirecting. - Make sure those tests pass!