Ruby on rails, devise, how to set up a user profile

I am new to rails and still new to development.

I installed a user controller, and I was able to create a view that displays the email address of the current user. Now I want a user profile page where the user can add personal information, etc., Track published messages, etc. The main functions of the community.

How do I create this? Should I create another controller and model like userprofile ? I already have a controller called users created during development. Can I reuse this or create a new one?

I would like some examples to get this idea. I'm still a little confused by the concepts used by rails.

+4
source share
1 answer

Your controller should be called a UserController, just to be sure. The model class will be called User, and the table for database users.

If you do the normal creation of a RESTfull controller, it will have index, new, show, and delete actions. This displays well what the user wants to do. The only thing you should think about is that all users should have the right to see all the information stored in the profile for the user, but this will not change if your model is userprofile.

+2
source

All Articles