I have just been through one of my apps converting the authentication from authlogic to devise. By and large this has been amazingly straight-forward to do but there is one issue I can’t find an easy fix for.
In the app, the user has the option of choosing their locale. Then whenever they login, they view the app in the language they choose. Previously, I did this by simply setting the locale in the create method of my UserSessions controller.
With Devise, all the controllers are automatically setup, which is great. I know that I could create a custom Controller that extends the DeviseController and do it like this but, from what I understand, that means that I will also need to create all the views to go with it which seems a bit over the top when I just need to run one extra line of code.
Is there an easier way of specifying some code to be run on a successful devise authentication?
I found the solution I was looking for here
As I just wanted to set the locale for the user when they logged in, all I needed was to add the following method to my ApplicationController