You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
401 B

class ProductsController < ApplicationController
def index
@products = Product.all
end
def new
@transgression = Product.new
end
def create
@product = Product.new(product_params)
if @product.save
redirect_to products_path
else
render :new
end
end
def product_params
return params.require(:product).permit(:name, :description, :weight)
end
end