Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise, how to create a edit profile page

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

like image 364
AnApprentice Avatar asked Jun 14 '11 19:06

AnApprentice


1 Answers

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.

like image 151
Matheus Moreira Avatar answered Sep 21 '22 18:09

Matheus Moreira