简体   繁体   English

设计-相同模型-不同页面和路线

[英]Devise - Same Model - Different pages & routes

I have two different kinds of users in my system. 我的系统中有两种不同的用户。 Trying to setup two different sets of devise pages / controllers for them. 尝试为它们设置两组不同的设计页面/控制器。

I can understand how this can be done when there are multiple models. 我可以理解在有多个模型的情况下如何做到这一点。 But wondering how this can be done with the same model? 但是,想知道如何使用同一模型吗?

eg. 例如。

/seller/sign_in

and

/buyer/sign_in

Use device_scope to change default route 使用device_scope更改默认路由

****Assuming you have user device model ****假设您拥有用户设备型号

  devise_scope :user do
    get "/seller/sign_in", to: 'devise/sessions#new'
    get "/buyer/sign_in", to: 'devise/sessions#new'
  end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM