class ProductsController < ApplicationController before_action :set_product, only: [:show, :edit, :update, :destroy] def index @products = Product.all end def show end def new @product = Product.new end def edit end def create @product = Product.create(product_params) @products = Product.all end def update @product.update(product_params) @products = Product.all end def destroy @product.destroy red