The current generated URL looks like /user?action_name=edit&id=42. However, if you use an authorization gem like cancancan this url requires the capability :index. If you only allow a user to edit itself, for example can :edit, ::User, id: user.id, the current URL would cause an Error to be thrown ( CanCan::AccessDenied ).
When we change action_name to action, the generated URL becomes /user/42/edit which matches the capability can :edit, ::User, id: user.id.
Coverage decreased (-0.2%) to 95.889% when pulling 97d21722241dbfc78b8f516588fee9937c491a92 on fuegas:user-edit-url into ce1bb5a1c166b62412e4032b2d1f798297a7c289 on railsadminteam:master.
The current generated URL looks like
/user?action_name=edit&id=42
. However, if you use an authorization gem like cancancan this url requires the capability:index
. If you only allow a user to edit itself, for examplecan :edit, ::User, id: user.id
, the current URL would cause an Error to be thrown ( CanCan::AccessDenied ).When we change action_name to action, the generated URL becomes
/user/42/edit
which matches the capabilitycan :edit, ::User, id: user.id
.Fixes #3514.