@Delete("/products/{product.id}") public void destroy(Product product) { repository.destroy(repository.find(product.getId())); result.redirectTo(this).index(); }
@Get("/products/{product.id}") public Product show(Product product) { product = repository.find(product.getId()); result.include("json", json.toJson(product)); return product; }