Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 just for the signed in and the signed out one. Did I have to overwrite the controller or there is another way?

Thank you!

like image 616
benoitr Avatar asked Nov 04 '10 14:11

benoitr


2 Answers

You just define it to an empty string in your local file. In this case you can see nothing.

like image 115
shingara Avatar answered Sep 21 '22 03:09

shingara


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.

like image 36
benoitr Avatar answered Sep 21 '22 03:09

benoitr