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

前端 未结 8 896
囚心锁ツ
囚心锁ツ 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:22

    Ok!

    As Shingara said I define an empty string in devise.en.yml

    sessions:
      signed_in: ''
    

    and I also change a bit the following line (provided by nifty-generators):

    <% flash.each do |name, msg| %>
      <%= content_tag :div, msg, :id => "flash" if msg.length > 0 %>
    <% end %>
    

    In that way, my css doesn't appear.

提交回复
热议问题