Development - Flash Notifications

Using rails with Devise, anytime you log in or write out a project, you get a Flash message on a page that doesn't seem necessary from the point of view of the user interface, it's usually pretty obvious, isn't it?

Is there a way to turn off flash notifications in the Design for Entry and Exit section?

thank

+3
source share
4 answers

Just try adding this code to session_controller.rb.

class SessionsController < Devise::SessionsController
  after_action :clear_sign_signout_flash, :only => [:create, :destroy]
protected
  def clear_sign_signout_flash
    if flash.key?(:notice)
      flash.delete(:notice)
    end
  end
end

Hope this helps :-)

+7
source

Devise : . Devise, //session_controller . Devise , . -.

+1

-, . i8n, , .

0
0

Source: https://habr.com/ru/post/1773964/


All Articles