Question

I use devise_security_extension in order to have some password security features in my app. I use password_expirable in one of my models, and when the password expires it goes to this view and I find no way to edit its content. Do you have any suggestion how I can control this view's HTML?

Was it helpful?

Solution

Currently, the gem will not automatically generate the view for you to edit. I think it's one of the things that people have asked for. In the meantime, you can manually create the file. If you look in the gem's: devise_security_extension/app/views/devise/password_expired/show.html.erb

You'll see the current template for the view that the gem uses. Copy and paste this file into your views/devise/password_expired/show.html.erb

You'll then be able to edit it the way you'd like.

The file looks like this:

<h2>Renew your password</h2>
  <%= form_for(resource, :as => resource_name, :url => [resource_name, :password_expired], :html => { :method => :put }) do |f| %>
  <%= devise_error_messages! %>

  <p><%= f.label :current_password, "Current password" %><br />
  <%= f.password_field :current_password %></p>

  <p><%= f.label :password, "New password" %><br />
  <%= f.password_field :password %></p>

  <p><%= f.label :password_confirmation, "Confirm new password" %><br />
  <%= f.password_field :password_confirmation %></p>

  <p><%= f.submit "Change my password" %></p>
<% end %>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top