diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index ad603e1..6de641d 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -127,17 +127,13 @@ class AccountController < ApplicationController if request.post? @user = current_user begin - @user.change_password!(params[:current_password], - params[:new_password], - params[:new_password_confirmation]) - session[:notice] = _('Your password has been changed successfully!') - redirect_to :action => 'index' - rescue User::IncorrectPassword => e - session[:notice] = _('The supplied current password is incorrect.') - render :action => 'change_password' + @user.change_password!(params[:current_password], + params[:new_password], + params[:new_password_confirmation]) + session[:notice] = _('Your password has been changed successfully!') + redirect_to :action => 'index' + rescue end - else - render :action => 'change_password' end end diff --git a/app/views/account/change_password.rhtml b/app/views/account/change_password.rhtml index 5578eff..cc1fff3 100644 --- a/app/views/account/change_password.rhtml +++ b/app/views/account/change_password.rhtml @@ -1,17 +1,19 @@
+<%= password_field_tag :current_password %>
- <% button_bar do %> - <%= submit_button :ok, _('Change password') %> - <% end %> -
+
+<%= password_field_tag :new_password %>
+<%= password_field_tag :new_password_confirmation %>