Skip to content

Instantly share code, notes, and snippets.

@mbuyco
Last active December 19, 2015 05:49
Show Gist options
  • Save mbuyco/5906983 to your computer and use it in GitHub Desktop.
Save mbuyco/5906983 to your computer and use it in GitHub Desktop.
def create
@product = Product.new(params[:product])
if @product.save
redirect_to user_url # user_url requires an ID
# redirect_to users_url -- use this to go to the users/index
else
render action: "new"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment