Created
July 17, 2016 04:01
-
-
Save andresprogra/4a4158d08148a7a0798ea2ed1bdabd3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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