Reputation: 1312
I have this route:
delete 'basket/remove' => 'flowercard_baskorder#remove', as: :basket_remove
This link in view:
<%= link_to "Remove", basket_remove_path %>
And this in my controller (the binding is just for me to test):
def remove
binding.pry
end
When the link is clicked on nothing happens and i have no idea why!? I'm obviosuly expecting the binding to kick in but doesn't even look like a request is made?
Cheers
Upvotes: 0
Views: 44
Reputation: 9700
You need to pass the method to the link_to
function
<%= link_to "Remove", basket_remove_path, method: "delete" %>
Upvotes: 0