Ruby-on-rails – Devise, how to create a edit profile page

deviseruby-on-railsruby-on-rails-3

I have a Rails 3 App using devise. I want to create a User/Profile edit page. Where a user can edit the name, add/change their photo etc…

I'd like to do this in the right rails/devise way. What's the way of handling this? I see a app/views/devise/registrations/edit.html.erb file

Do I edit that file?

Or do I create a app/views/users/edit.html.erb and customize that experience? But then what do you do regarding the controller? Create a new controller?

Thanks

Best Answer

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

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

You can generate them with rails g devise:views.