Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created February 25, 2010 09:46
Show Gist options
  • Save workmad3/314418 to your computer and use it in GitHub Desktop.
Save workmad3/314418 to your computer and use it in GitHub Desktop.
Finally, if the customization at the views level is not enough, you can customize each controller by following these steps:
1) Create your custom controller, for example a Admins::SessionsController:
class Admins::SessionsController < Devise::SessionsController
end
2) Tell the router to use this controller:
devise_for :admins, :controllers => { :sessions = "admin/sessions" }
3) And finally, since we changed the controller, it won't use "devise/sessions" as views anymore, so remember to make a copy of "devise/sessions" to "admin/sessions".
Remember that Devise uses flash messages to let users know if sign in wass successful or not. Devise expects your application to call "flash[:notice]" and "flash[:alert]" as appropriate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment