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