Sinatra アプリがあり、そこに ajax メソッドがあります。以前は 200 と結果を返しました。これで 302 が返され始め、結果はまだ正しいままです(Google Chrome デバッグ コンソールで確認できます)。
xaml コードは次のとおりです。
:javascript
$(document).ready(function() {
$(document).on("click", "#my_id", function(){
$.ajax({
type: "GET",
url: "/my_url",
success: function(data){
window.location = data;
}
});
});
});
def my_url
#getting a data.....
#returning the data... there is nothing unusual
end
更新:それが私がしたことです:
def my_url
result = get_result()
response.headers['Location'] = request.referer
result
end
しかし、Location
ヘッダーはResponse
変更されておらず、エラーが残っています。