开发者

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 ca开发者_运维百科n I have separate views for each model?

thanks


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜