O'Reilly logo

Learning Devise for Rails by Nia Mutiara, Hafiz, Giovanni Sakti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customizing your Devise layout

There are times when you have more than one Devise model in one application, and a question comes to your mind, such as "How do I maintain its views so that they will have different views?" Previously, I wrote about generating views, so you can make some custom changes to the views by executing the following command:

$ rails generate devise:views

Now, you are going to learn about how to generate scoped views in Devise. At first, you need to make a little modification to config/initializers/devise.rb. You need to remove the comment tag for this code:

config.scoped_views = true

This code will enable scoped views for Devise, so you can generate some specific views for your Devise model.

Before we start generating views, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required