I want the ajax post to be able to go to the main page. For some reason, I keep doing it wrong. Any idea what I should do to fix this?
window.APP_ROOT_URL = "<%= root_url %>";
Ajax
$.ajax({ url: '#{addbank_bankaccts_path}', type: 'POST', beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', '#{form_authenticity_token}')}, dataType: "json", data: 'some_uri=' + response.data.uri , success: function(APP_ROOT_URL) { window.location.assign(APP_ROOT_URL); } });
jquery ajax
Alain goldman
source share