Skip to content

Instantly share code, notes, and snippets.

@andresprogra
Created July 17, 2016 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresprogra/4a4158d08148a7a0798ea2ed1bdabd3a to your computer and use it in GitHub Desktop.
Save andresprogra/4a4158d08148a7a0798ea2ed1bdabd3a to your computer and use it in GitHub Desktop.
def create
@product = Product.new(product_params)
if @product.save
redirect_to @product
else
render :edit
end
end
private
def product_params
params.require(:product).permit(:title, :description, :price, :state)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment