Fix RoutingError when changing username to non ascii char.

This commit is contained in:
Sato Hiroyuki 2013-03-26 14:42:08 +09:00
parent 90db28d6d0
commit 33e236c631
3 changed files with 33 additions and 0 deletions

View file

@ -84,6 +84,8 @@ class Admin::UsersController < Admin::ApplicationController
format.html { redirect_to [:admin, admin_user], notice: 'User was successfully updated.' }
format.json { head :ok }
else
# restore username to keep form action url.
admin_user.username = params[:id]
format.html { render action: "edit" }
format.json { render json: admin_user.errors, status: :unprocessable_entity }
end