Rails: redirect_to with :error, but flash[:error] empty

前端 未结 3 2002
孤城傲影
孤城傲影 2020-12-04 10:18

I\'m trying to do a redirect while setting the flash[:error] value. (Rails 3.0.10)

In my view I have

<%= flash[:error] %>

3条回答
  •  独厮守ぢ
    2020-12-04 10:29

    If you are having problem to keep the flash after redirecting to another path, then use this.

    flash.keep
    

    in your method, before redirecting.

提交回复
热议问题