6107

devise_security_extension: edit the password/expired/show view

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?

Answer1:

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 <a href="https://github.com/phatworx/devise_security_extension/blob/master/app/views/devise/password_expired/show.html.erb" rel="nofollow">gem's</a>: 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! %>

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

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

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

<%= f.submit "Change my password" %>

<% end %>

Recommend

  • Rails 4: CanCanCan abilities with has_many :through association
  • Import Drupal user accounts into Rails without requiring users change their passwords
  • How does sign_in_and_redirect in devise work?
  • autotest and rspec giving different answers
  • Devise: undefined method `user_signed_in?' for ApplicationController:Class
  • How to browse android SDK sources in Android studio 2.0
  • Is it possible to ask GIT, don't show a file?
  • How to generate an asynchronous reset verilog always blocks with chisel
  • Heroku push rejected - Hartl's Rails 3.2 tutorial
  • Is it better to have roles as a column on my users table, or do it through join tables (Roles &
  • Segmentation Fault on MySQL2 / Ruby 1.9.3 / Rails 3.2
  • How to create two column output from a single column
  • Failed to find version-tag string. File must be updated
  • Alamofire and Reachability.swift not working on xCode8-beta5
  • Azure table store snapshot/backup capability
  • SetWindowsHookEx does not react on media keys
  • Ember.js model to be organised as a tree structure
  • Installing iPhone App to iPhone
  • Abort upload large uploads after reading headers
  • Sencha Touch 2.0 Controller refs attribute not working?
  • Could not find rake using whenever rails
  • Typescript - Unable to get 'import' statement to function
  • why do I get the error when installing the gem 'pg'? [duplicate]
  • Nant, Vault & Windows Integrated Authentication
  • swift auto completion not working in Xcode6-Beta
  • Bug in WPF DataGrid
  • Excel - Autoshape get it's name from cell (value)
  • How to add a column to a Pandas dataframe made of arrays of the n-preceding values of another column
  • jQuery tmpl and DataLink beta
  • How can I estimate amount of memory left with calling System.gc()?
  • Traverse Array and Display in markup
  • Data Validation Drop Down Box Arrow Disappearing
  • How to get icons for entities from eclipse?
  • Proper way to use connect-multiparty with express.js?
  • NSLayoutConstraint that would pin a view to the bottom edge of a superview
  • Load html files in TinyMce
  • Why joiner is not used after Sequence generator or Update statergy
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • JaxB to read class hierarchy
  • Android Heatmap on canvas or ImageView