No commit activity in last 3 years
No release in over 3 years
Easily add Password fields to your administrate views
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

AdministrateFieldPassword

Gem

All you need to integrate Password with Administrate.

Installation

Add this line to your application's Gemfile:

gem 'administrate-field-password'

And then execute:

$ bundle install

Usage

In your Dashboard use the field type Field::Password for your password attribute in ATTRIBUTE_TYPES i.e.

ATTRIBUTE_TYPES = {
  user_password: Field::Password
}

And then add the attribute to the FORM_ATTRIBUTES list.

FORM_ATTRIBUTES = [
    # Some other attributes...
    :user_password
  ].freeze

If in you are displaying the password field on your forms, add this to your UserController

module Admin
  class UsersController < Admin::ApplicationController
    def update
      params[:user].delete(:password) if params[:user][:password].blank?
      super
    end
  end
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DisruptiveAngels/administrate-field-password.

License

MIT License