I need my Rails application to allow users with: admin to access the sign_up page and add users. However, if someone signed (admin or otherwise), Devise redirects them and displays a message "already signed" associated with an already validated error.
I know that there are other, more reliable ways to get around this, for example, creating a new controller to override the standard in Devise, but since I'm pretty new to Rails and my current needs are small, I just wanted to disable this "already tested" one, to redirect it completely. Then I could easily add an “if” statement to the top of the sign_up page so that ordinary users don’t get out of this, but they still skip those who have: admin. I could do the same with the sign_in page and run it with "if signed_in?" a request to see if the user was currently signed up and redirect if necessary independently. Easy peasy (I think).
I spilled Devise documents and their lib files, but could not pinpoint exactly where this redirect is being processed, if that is really what it does at all.
Any help is appreciated and thanks in advance.
source
share