the delete method is not working when trying to destroy a record. When clicking on the button, it will redirect me to shops#show action, looks like the method: :delete is not working...Any help please?
Routes
resources :shops
HTML
<% @shops.sort.each do |shop| %>
<tr>
<td><%= shop.name %></td>
<td><%= shop.email %></td>
<td><%= shop.direction %></td>
<td>
<%= link_to '<button>Borrar</button>', shop, method: :delete, data: { confirm: "Seguro?" } %>
</td>
</tr>
<% end %>
Controller
def destroy
@shop = Shop.find(params[:id])
@shop.destroy
respond_to do |format|
format.html { redirect_to "/sushiadmin", notice: 'Se ha editado la tienda.' }
format.json { head :no_content }
end
end