I have a list of links that users can click. When a click is made, I want to increment a counter (to track how many users clicked that link) and then open the link in a new window.
Right now, in the 'show' method method, I can do all that except the "new window" thing. Is there a way to achieve this in pure rails or do I have to do put some additional javascript to launch an ajax request (for the incrementation) and then open the link in a new window?
thanks, Pierre
I would think the easiest solution would be to just have your link contain
target="_blank"
The window would open, go to your counter page, and get redirected to the correct page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With