Your url is the path to the controller file, it should be the route adress
you can use the Request::ajax()
to make sure that you only response to the ajax requests, and as pmall said, you ajax request must be your route url ( check https://github.com/aaronlord/laroute if you want to use your routes within your javascript files)
if (Request::ajax()) {
return View::make('class.ajax_new', $data);
} else {
return View::make('class.new', $data);
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community