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? %>
<%= f.label :old_password, 'Current Password' %>
<%= f.password_field :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.button 'Change Password', type: 'submit' %>
<% end %>