10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/cardboard/my_account_controller.rb', line 10
def update
admin_user_method = Cardboard.user_class.to_s.underscore.gsub(/\//,'_').to_sym
@user = cardboard_user
if params[admin_user_method][:password].blank?
params[admin_user_method].delete("password")
params[admin_user_method].delete("password_confirmation")
end
if @user.update_attributes(strong_params[admin_user_method])
request.env['warden'].session_serializer.store(@user, admin_user_method)
flash[:success] = "User information updated successfully"
redirect_to my_account_path
else
render :edit
end
end
|