Topic: Can someone explain where the devise controllers are?

Using devise 2.1.0

Where are the devise controllers?
I see references on the web like 'app/controllers/devise/controller_name.rb'
However, my controllers subdirectory has no devise directory.

Is this like the devise views, which remain hidden for some reason until you type 'rails generate devise:views'?
I tried 'rails generate devise:controllers' but that just got me an error message.

Where are they?

Thanks for any help. --Fred

Re: Can someone explain where the devise controllers are?

Go to the top directory for your project and run this:
        find . -name controller_name.rb
This command says to start in the current

Re: Can someone explain where the devise controllers are?

In my rails application, the controllers created through 'rails generate scaffold ..' are all named 'model_name_controller.rb', but when I search on *_controller.rb all I get are the controllers that rails created through generate scaffold.

I assume there must be devise controllers, otherwise when, for example, the devise session view 'new.html.erb' is instantiated in a browser and the user clicks 'sign in', isn't the submit processed by a controller as per the rails 'convention over configuration'?

So where is it?

Re: Can someone explain where the devise controllers are?

Devise controller are not inside your app, if you need to modify a method, just create a normal controller for user and replace the method name, for example create, show, etc or add new methods if you need to

Re: Can someone explain where the devise controllers are?

The thing is, I don't want to override devise I want to supplement it.

What I want to do is, after the devise sessions controller does whatever it does to create a session, I would like to then direct the signed-in user to a particular page based on characteristics of the user.  For example, if current_user.admin? = true, I would like to direct the user to the admin page.  But if I create my own sessions controller with a 'create' method, and this overrides the devise sessions controller, then devise won't do the things it needs to do to create a session for the user and sign them in.

How do I tell rails and/or devise to send the just-signed-in user to the page of my choice and not to a page of devises choice?

Unless there is a good answer to this I guess I will look into CanCan and see if it gives me control of the after-sign-in actions.

Re: Can someone explain where the devise controllers are?

if that's what you want you'll need to read the Devise Wiki
https://github.com/plataformatec/devise/wiki/_pages

check out
"How To: redirect to a specific page on successful sign in"

Re: Can someone explain where the devise controllers are?

Thanks for your reply.
Oddly, the page you reference, "How to: redirect to a specific page on successful sign in" has only the following sections:
'redirect back to current page after signin?'
'redirect back to current page after oauth signin?'
'redirect back to current page without oauth signin?'

What's up with that?  I want to direct to a specific page that isn't the current page!
Anyway, you've given me a place to do some searching, I will see what I can find.

Re: Can someone explain where the devise controllers are?

then change the current page for an specific one

Re: Can someone explain where the devise controllers are?

Eventually I found this: create a sessions controller that derives from the devise sessions controller, and add this to it:

def after_sign_in_path_for(employees)
   'path/to/desired/file.html'
end

Unfortunately this is way too simplistic.  I need to create the link they go to after login, which will depend on the employee that signed in.  For example, my employee number is 10119, and I need to link to
website.com/employees/10119/timecard

So, how do I get information about who signed in so I can send them to the appropriate URL?

Thanks.  --Fred

Re: Can someone explain where the devise controllers are?

Is that it then?  This is just another topic for which the rails community has no answer?

And while I'm bitching, can anyone tell me why ruby/rails code listings are never commented?