Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off alert message in Devise Rails

I'm using Devise for my Rails 3 app.

How do I turn off Devise's alert messages for sign on/off successfully?

like image 471
AdamNYC Avatar asked Mar 24 '12 20:03

AdamNYC


1 Answers

You can either:

  1. Go to config\locales\devise.en.yml and change the lines you want to empty strings (deleting them won't work). So, like this:

    sessions:
      signed_in: ''
      signed_out: ''
    
  2. Or extend/override devise's sessions controller. To do this, copy the create and destroy actions code from here, and paste it in a controller (let's call it sessions) that inherits from devise's sessions controller, like this:

    class SessionsController < Devise::SessionsController
    

    Then remove the calls to set_flash_message. Finally, edit your routes file so this change takes effect:

    devise_for :users, :controllers => { :sessions => 'sessions' }
    
like image 84
Ashitaka Avatar answered Sep 19 '22 18:09

Ashitaka