Challenge 1: A Product Form — Solution <%= form_with model: product do |f| %> <%= f.label :name %> <%= f.text_field :name %> <%= f.label :description %> <%= f.text_area :description %> <%= f.label :in_stock %> <%= f.check_box :in_stock %> <%= f.submit %> <% end %> =begin Notes: - form_with model: product handles both the new-product and edit-product cases with this single partial -- if product is a new, unsaved record, the form POSTs to /products (create); if it's an existing, persisted record, it submits as PATCH to /products/:id (update), all decided automatically from the object's own state. - f.text_field, f.text_area, and f.check_box each generate their appropriate HTML input type, all automatically named product[name], product[description], and product[in_stock] respectively -- matching the nested params structure a product_params strong-parameters method (Challenge 2) would expect. - f.submit with no arguments generates a submit button whose label automatically reads "Create Product" or "Update Product" depending on whether product is new or already persisted, again inferred rather than hardcoded. =end