Rails Flash.now not working

后端 未结 5 914
-上瘾入骨i
-上瘾入骨i 2020-12-23 16:56

I have a view from which I make an ajax request to the controller and after the action is successfully completed I initialize the flash.now[:notice]. But af

5条回答
  •  再見小時候
    2020-12-23 17:53

    When redirecting use

    flash[:notice] = "This message value is available in next request-response cycle"
    

    When rendering use

    flash.now[:notice] = "Message is available in same request-response cycle"
    

    Info from here

提交回复
热议问题