Are controllers in devise automatically generated? How do you access them?
I know for views you do
rails generate devise_views
.
see @ErikTrautman's answer.
you must inspect the source (specifically, in the project root's app/
directory). @MatheusMoreira provides a link to the source on GitHub, but if you'd rather browse it locally in your own text editor, you can find the install location of the Devise gem with gem which devise
.
For instance, to see Devise::SessionsController
:
$ vim $(gem which devise | sed 's|\(.*\)\(/.*\)\{2\}|\1|')/app/controllers/devise/sessions_controller.rb
(Or, you could just clone the git repo and poke around that way.)
$ git clone https://github.com/plataformatec/devise
$ cd devise
$ vim app/controllers/devise/sessions_controller.rb