Commit 2d2f78616530a41d7bd3efc33a9596510b9b4c63
1 parent
de6ebf56
Exists in
master
and in
23 other branches
change-password: implementing temporary changes to error_messages_for on change_password
AI3012
Showing
2 changed files
with
10 additions
and
13 deletions
Show diff stats
app/controllers/public/account_controller.rb
| @@ -135,9 +135,6 @@ class AccountController < ApplicationController | @@ -135,9 +135,6 @@ class AccountController < ApplicationController | ||
| 135 | rescue User::IncorrectPassword => e | 135 | rescue User::IncorrectPassword => e |
| 136 | session[:notice] = _('The supplied current password is incorrect.') | 136 | session[:notice] = _('The supplied current password is incorrect.') |
| 137 | render :action => 'change_password' | 137 | render :action => 'change_password' |
| 138 | - rescue ActiveRecord::RecordInvalid | ||
| 139 | - session[:notice] = _("Passwords don't match!") | ||
| 140 | - render :action => 'change_password' | ||
| 141 | end | 138 | end |
| 142 | else | 139 | else |
| 143 | render :action => 'change_password' | 140 | render :action => 'change_password' |
app/views/account/change_password.rhtml
| 1 | <h1><%= _('Change password') %></h1> | 1 | <h1><%= _('Change password') %></h1> |
| 2 | 2 | ||
| 3 | -<% form_tag do %> | 3 | +<%= error_messages_for :change_password %> |
| 4 | 4 | ||
| 5 | -<p><label for="password"><%= _('Current password') %></label><br/> | ||
| 6 | -<%= password_field_tag :current_password %></p> | 5 | +<% form_for(:change_password) do |f| %> |
| 7 | 6 | ||
| 8 | -<p><label for="password"><%= _('New password') %></label><br/> | ||
| 9 | -<%= password_field_tag :new_password %></p> | 7 | + <%= labelled_form_field(_('Current password'), (f.password_field :current_password)) %> |
| 8 | + <%= labelled_form_field(_('New password'), (f.password_field :new_password)) %> | ||
| 9 | + <%= labelled_form_field(_('Confirm your new Password'), (f.password_field :new_password_confirmation)) %> | ||
| 10 | 10 | ||
| 11 | -<p><label for="password_confirmation"><%= _('Confirm your new Password') %></label><br/> | ||
| 12 | -<%= password_field_tag :new_password_confirmation %></p> | ||
| 13 | - | ||
| 14 | -<%= submit_button :ok, _('Change password') %> | 11 | + <p> |
| 12 | + <% button_bar do %> | ||
| 13 | + <%= submit_button :ok, _('Change password') %> | ||
| 14 | + <% end %> | ||
| 15 | + </p> | ||
| 15 | 16 | ||
| 16 | <% end %> | 17 | <% end %> |
| 17 | - |