开发者

Rails/Devise: How to modiy the controller for /users/edit?

开发者 https://www.devze.com 2023-03-20 06:41 出处:网络
I use Devise and right now /users/edit contains only Devise\'s password change form. I want to add a user settings form.

I use Devise and right now /users/edit contains only Devise's password change form. I want to add a user settings form.

I am new to Rails, what is the best way to do this?

The view for /users/edit seems to be in /app/views/devise/passwords/edit.html.erb.

The controller for /users/edit is nowhere to be found. How to extract it from Rails's magic so that I c开发者_运维技巧an modify it?


The appropriate view is app/views/devise/registrations/edit.html.erb. You dont need controller to add additional fields into the registrations form, even if its a nested form fields of another model. Just make appropriate changes in your User model to save nested associations (accepts_nested_attributes_for), attr_accessible etc.

0

精彩评论

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