ruby on rails - Have multiple edit forms. Need to modify update method and routes -


There is a user model with my name, email, password and bio.

I have to do this two kinds of edit type

a) If the update_attributes fails in updates

the method, Instead of just edit , presenting the correct page is my current update method.

  def update @ user.update_attributes (params [: user]) Flash [: success] = "profile updated" sign_in @user redirect_to @user else render 'edit' end '   

b) How do I change / users / 1 / edit to change_password method? So I need something like / users / 1 / change_password .


b) matches' / users /: id / change_password ', for:' user #

redirect_to edit_user_path (@user)

code>

should work.

In addition, I will change my change_password paths in such a way:

  Resources: Users subscribe 'change_password' end of the end   

After which there is a more rail-way to do things, you can change

redirect_to - password_password_user_path (@user)

Comments