Basically, you are already allowed to access your user account when you activate the registerable module in the model. To access the page, you need to log in first and then go to /users/edit
. The page is as shown in the following screenshot:
But, what if you want to edit your username or e-mail ID? How will you do that? What if you have extra information in your users
table, such as addresses, birth dates, bios, and passwords as well? How will you edit these? Let me show you how to edit your user data including your password, or edit your user data without editing your password.
Editing your data, including the password: To perform this action, the first thing that you need to do is modify your view. Your view should contain the following code:
<div><%= f.label :username %><br /> <%= f.text_field :username %></div>
Now, we are going to overwrite Devise's logic. To do this, you have to create a new controller named...