https://github.com/valiot/administrate-field-password
https://github.com/valiot/administrate-field-password
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/valiot/administrate-field-password
- Owner: valiot
- License: mit
- Created: 2016-02-26T19:49:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-16T18:18:14.000Z (over 8 years ago)
- Last Synced: 2024-10-13T23:16:12.551Z (8 months ago)
- Language: Ruby
- Size: 8.79 KB
- Stars: 3
- Watchers: 9
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AdministrateFieldPassword
[]()All you need to integrate Password with Administrate.
## Installation
Add this line to your application's Gemfile:
```ruby
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.
```ruby
ATTRIBUTE_TYPES = {
user_password: Field::Password
}
```
And then add the attribute to the `FORM_ATTRIBUTES` list.
```ruby
FORM_ATTRIBUTES = [
# Some other attributes...
:user_password
].freeze
```If in you are displaying the password field on your forms, add this to your `UserController`
```ruby
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](https://github.com/DisruptiveAngels/administrate-field-password/blob/better_readme/LICENSE)