Override devise registrations controller

前端 未结 5 1781
渐次进展
渐次进展 2020-11-22 00:05

I have added a field to the sign-up form that is based on a different model, see How do I use nested attributes with the devise model for the gory details. This part is work

5条回答
  •  遇见更好的自我
    2020-11-22 00:52

    You can generate views and controllers for devise customization.

    Use

    rails g devise:controllers users -c=registrations
    

    and

    rails g devise:views 
    

    It will copy particular controllers and views from gem to your application.

    Next, tell the router to use this controller:

    devise_for :users, :controllers => {:registrations => "users/registrations"}
    

提交回复
热议问题