Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

you may want to check jquery's ajax function

$.ajax({
  type: "DELETE",
  url: "{{ URL::route('someroute') }}"
});
0

It works thank you very much! I used 'URL::to' (I think 'URL::route' is for named routes)

url: "{{ URL::to('admin/categories/" + idtodelete +"')}}"
Last updated 9 years ago.
0

But I see strange behavior, the browser doesn't go to the address admin/categories/3 (3 for the example). It just deletes the record. I don't understand, It gets deleted without using the route??

Edit: I checked it with NetBeans, the code in the route and the code in the controller destroy method, do get executed. But the redirection (in the destroy method) does not happen,I don't understand why.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

panosss panosss Joined 18 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.