I'm trying to call the 'tariff' action of my 'countries' controller using jQuery ajax() and pass it a country name in the following format:
/countries/tariff/countryname
however, with the following code ( set to GET ), it is calling this with the get '?' added:
/countries/tariff/?countryname
$(document).ready(function(){
$('#CountriesIndexForm select').change(function(){
$.ajax({
type: "GET",
url: "/countries/tariff/",
data: escape($(this).val()),
success: function(html){
$(this).parent().next('div').html(html);
}
});
});
});
I understand its because the type: is set to GET, but is there a fix for this?