Actions
Patch #33117
openRedirect to users_path instead of edit_user_path in order to avoid confusion
Status:
New
Priority:
Normal
Assignee:
-
Category:
Accounts / authentication
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Currently, a user is redirected to edit_user_path
(/users/*/edit) after creating a user. However, I think it is better to be redirected to user_path
(/users) for the following reasons:
- Inconsistent. There are some exceptions but most forms in Admin page shows index page after an object is created
- Confusing. Today I observed that an admin mistakenly rewrote the user that has just created. It is because they misunderstood that the form is /users/new, but it was actually /users/*/edit
- I cannot find any use cases that showing
edit_user_path
is better thanusers_path
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 2fb297874..d3e853b43 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -122,7 +122,7 @@ class UsersController < ApplicationController
attrs = {:generate_password => @user.generate_password }
redirect_to new_user_path(:user => attrs)
else
- redirect_to edit_user_path(@user)
+ redirect_to users_path
end
}
format.api { render :action => 'show', :status => :created, :location => user_url(@user) }
Files
Related issues
Actions