Devise/Rails - How to remove a particular flash message? (Signed in Successfully)

前端 未结 8 919
囚心锁ツ
囚心锁ツ 2020-12-13 12:38

Using Devise, I would like to know if there is a way to remove a particular flash message? (Signed in Successfully).

I care about other msg in the view, so It is jus

8条回答
  •  醉话见心
    2020-12-13 13:28

    You can do this, Kindly change the condition type and flash type accordingly.

    flash.delete(:alert) if flash[:alert] == "You need to sign in or sign up before continuing." @drivers = params[:keyword].blank? ? [] : Driver.find(params[:keyword])

    You can do it in before filter.

提交回复
热议问题