Jquery Rails 6 Ajax request/Missing template with repond_to

Hi guys, I am using jquery to make a request with Ajax however i keep getting a missing template error where as I added the remote :true option in my link_to. Here is the stackoverflow link of the issue with detailled code. https://stackoverflow.com/questions/69005475/missing-template-jquery-with-rails-6-and-respond-to