Password Change
<% if flash[:notice] %>
<%= flash[:notice] %>
<% end %>
<% if flash[:alert] %>
<%= flash[:alert] %>
<% end %>
<% if @credential.updated_at %>
Your have been using the same password for
<%= time_ago_in_words @credential.updated_at, include_seconds: true %>.
<% end %>
<%= form_for @credential, url: change_password_session_path,
as: :credential, method: :post do |f| %>
<% unless @credential.new_record? %>
<%= label_tag :old_password, 'Current Password' %>
<%= password_field_tag :old_password %>
<% end %>
<%= f.label :password, 'New Password' %>
<%= f.password_field :password %>
<%= f.label :password_confirmation, 'Re-enter New Password' %>
<%= f.password_field :password_confirmation %>
<%= f.submit 'Change Password' %>
<% end %>