Created
August 6, 2019 14:25
-
-
Save ralfting/b70c914b9114b76943e8b2a42152aa92 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
if already_on_cart | |
redirect_to checkout_path | |
# return render js: "toastr.warning('Este item já está em seu carrinho de compras.')" | |
elsif user_signed_in? && current_user.owns?(@product) | |
return render js: "toastr.warning('Aparentemente você já adquiriu este item.')" | |
else | |
@shopping_cart.add(@product, @product.cost) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment