我想表明在成功AJAX更新Flash成功通知,通常我顯示通過由動作閃光燈通知,觸發閃光燈通知 - Ruby on Rails的
def something
redirect_to "that_controller_path", :notice => "Success"
end
但是我有沒有線索至於如何做到這一點的AJAX調用成功,我的Ajax調用,
$.ajax(
{
type: "POST",
url: path,
data: response1,
contentType: "application/json",
success: ->
window.location.replace(window.location.protocol + "//" +
window.location.host + "/configuration/manage_users")
#Something here!
});
閃光燈通知是在我的應用程序視圖,
<%if flash[:notice]%>
<div class="flash_notice">
<%=flash[:notice]%><br>
</div><!-- close -->
<%end%>