我想将它分成几个部分,以获得更好的UI,类似于
/account/settings /account/password /account/notices /account/disable
此外,当用户想要更改密码时,我想要求用户输入他们当前的密码.
有了设计,为了实现这一点,这需要一个新的控制器,还是可以用路由来处理?
另外,编辑页面目前位于这里:app / views / devise / registration
你建议在这里添加这些页面吗?或在/ app / views / users?
谢谢
解决方法
>通过继承设备来重写设备的注册控制器,并更新相应的视图和路由.这是什么设计的site这样说:
Configuring controllers
If the customization at the views
level is not enough,you can customize
each controller by following these
steps:1) Create your custom controller,for
example a Admins::SessionsController:class Admins::SessionsController < Devise::SessionsController
end2) Tell the router to use this
controller:devise_for :admins,:controllers => { :sessions => “admins/sessions” }
3) And since we changed the
controller,it won’t use the
“devise/sessions” views,so remember
to copy “devise/sessions” to
“admin/sessions”.Remember that Devise uses flash
messages to let users know if sign in
was successful or Failed. Devise
expects your application to call
“flash[:notice]” and “flash[:alert]”
as appropriate.