Rails + Devise: Wrong Sign out message

devise, message, ruby-on-rails

Solution

It looks like there's a way to handle custom layouts for devise without inheriting the sessions controller. Take a look at this documentation:

https://github.com/plataformatec/devise/wiki/How-To:-Create-custom-layouts

EDIT

To redirect users back to the sign in page after they sign out add this to your application controller:

def after_sign_out_path_for(resource_or_scope)
  sign_ins_path
end

Problem

I use Devise to perform authentication for my application, and everything is ok, except the Devise logout message which is detected as unauthentication failure: `en.devise.failure.unauthenticated: " You need to sign in or sign up before continuing "` I mean that I have this message when I log out, and not the "Signed out successfully" message. Maybe I wrongly personnalized my Devise system. Here are the personnalisations I made: 1/ I used my own session controllers to override the default Devise session controller. My only objective, is to choose a special access (login/signup) layout: ``` class SessionsController < Devise::SessionsController layout 'access' end ``` No more code. I only wanted to render using a special login/signup design, located in `views/layouts/access.html.haml`. Of course, I added this to my `routes.rb` file: ``` devise_for :users, :controller => { :sessions => 'sessions' } ``` 2/ I choosed another language for Devise (french), so I downloaded `devise.fr.yml` and pasted it in `config/locales/` folder, and set `config.i18n.default_locale = :fr` in `config/application.rb` file All other Devise action messages are correct. Only "Sign Out" have trouble. Any idea? Thanks in advance.

Original source