If you're using a Rails helper, you can do this:
<%= link_to path,
confirm: "Confirmation message",
} do %>
Your link text with or whatever
<% end %>
Posted in Is there any Spree series anywhere?
First of all, I love all the content here. I literally wanna learn the contents of every video I watch. Everything is like "wow, that's cool, I could use that" to me, so thanks a lot. Now on to my question.
I'm really amazed that I can't find a complete series about making an e-commerce with Spree, where people add functionality to it and customize fields, views, add JS to update the cart and so on.
Do you know anything like that? I have so many questions and I've customized Spree in the past in a very dirty way. It's kind of hard for me to understand everything in Spree's source code because I have to google every keyword I don't know how works. I'm new to Ruby/Rails though I've used Java Spring 5, Python, C, and stuff like that so I'm not completely new to programming.
This came to my mind in this opportunity because I need to make a custom "Apply Coupon" functionality, where the discount is based off of the normal price (instead of a 'sale price' field that was introduced by someone else [a promotion that's not a Spree::Promotion]) when the normal price+coupon is better than the sale price alone (i.e. you shouldn't be able to apply coupons on orders that already have a better discount), and I had to swim through a LOT of methods, and even know I feel my solution sucks and I'm not really using Spree conventions or good Object-Orientation for that matter.