update_username.js.haml 233 Bytes EditWeb IDE 1 2 3 4 5 6 7 - if @user.valid? :plain new Flash("Username successfully changed", "notice") - else - error = @user.errors.full_messages.first :plain new Flash("Username change failed - #{escape_javascript error.html_safe}", "alert")