Merge pull request #3392 from hiroponz/fix-non-ascii-char-username

Fix RoutingError when changing username to non ascii char.
This commit is contained in:
Dmitriy Zaporozhets 2013-03-30 15:07:11 -07:00
commit 6005ec894a
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