Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3: Different views for each model

I have two models using Devise and I want the views to be different from one another. However, it only has one new.html.erb view, etc.

How can I have separate views for each model?

thanks

like image 505
donald Avatar asked Dec 29 '10 15:12

donald


1 Answers

If i am reading you correctly, assuming that you created a User model and, say, a Admin model, you'll want to do what is known as set devise up for Scoped Views.

You can generate the views for each model by calling rails generate devise:views users.

Then set config.scoped_views = true inside "config/initializers/devise.rb".

All of this is in the README as an fyi.

like image 179
pjammer Avatar answered Sep 20 '22 19:09

pjammer