I am new to Rails.
I have a User model. I would like a web page that allows users to change their :name and :email, and another web page that allows them to change their password.
Right now, I have a form to edit :name and :email at
/users/1/edit
The form on the page is
<%= form_for(@user) do |f| %>
My routes.rb has
resources :users
This works. Users can edit their :name and :email just fine. How do I now set up another web page with another form that allows them to change their password?
Thank you.
You can set up any actions you like in your controller. The default CRUD operations are there to cover the basics, but there is no inherent limitation to what you can do.
The above would create the route:
/users/1/change_password
In the view you simply have the change password fields => the form basically stays the same, submitting to your existing update action.