Where are the views for Devise in a Rails app?

Written by Michael Lee on August 5, 2018

Devise is a sweet gem that provides authentication for a Rails application.

One of the things that I couldn’t figure out when I first started using Devise, is where the various views that Devise rendered came from. Going to the app/views folder didn’t reveal anything obvious.

It turns out according to the gem documentation, that Devise packages all of its views inside the gem itself. Meaning by default you can’t make changes to the views that Devise renders.

Turns out you can get Devise to dump and use the view files locally within your Rails app. To do that you’ll want to run this command from the command-line from within your application project folder:

$ rails generate devise:views

Running the command above will now create a subfolder called devise within your app/views folder. Now you can tweak the look and feel of the login and registration views.

Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design, side projects and working remotely. Sign up and I'll send you my articles straight to your email.

:wave: Hey hey, I'm Michael Lee! I really appreciate you taking the time to read this article.

Be sure to check out my other articles.