How to create an edit profile page

I have a Rails 3 application using a program. I want to create a User / Profile edit page. If the user can edit the name, add / change his photo, etc.

I would like to do this in the right rails / inventive abilities. What is the way to handle this? I see the file app / views / devise / registrations / edit.html.erb

Change this file?

Or can I create the app /views/users/edit.html.erb and customize this experience? But what are you doing regarding the controller? Create a new controller?

thanks

+7
source share
2 answers

You can edit the devise/registrations/edit.html.{erb,haml} and customize it according to your needs, maybe even add any additional fields that may be in your user model, but not in the form.

I believe that it is also possible to have a common CRUD interface for users along with Devise's, but then you will need to create a new controller and add views, that's all, therefore it is easier and more preferable to simply override Devise views to change or add what you need.

You can generate them using rails g devise:views .

+12
source

You can also create a user profile editing page directly using your controller in an application that changes your user model accordingly.

0
source

All Articles