Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhyegocalota/active_admin-form_errors
Pretty form errors by default in your ActiveAdmin. :lipstick:
https://github.com/dhyegocalota/active_admin-form_errors
activeadmin activeadmin-plugin formtastic rails ruby
Last synced: 4 months ago
JSON representation
Pretty form errors by default in your ActiveAdmin. :lipstick:
- Host: GitHub
- URL: https://github.com/dhyegocalota/active_admin-form_errors
- Owner: dhyegocalota
- License: mit
- Created: 2017-10-14T18:09:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-16T12:24:15.000Z (over 7 years ago)
- Last Synced: 2024-03-19T02:56:05.245Z (11 months ago)
- Topics: activeadmin, activeadmin-plugin, formtastic, rails, ruby
- Language: Ruby
- Homepage:
- Size: 220 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ActiveAdmin Form Errors
Pretty form errors by default in your ActiveAdmin.
## Installation
**1. Import gem**
```ruby
gem 'active_admin-form_errors'
```**2. Import stylesheets (change `app/assets/stylesheets/active_admin.scss`)**
```scss
@import 'active_admin/form_errors';
```## Options
**Disable it in a specific resource**
```ruby
ActiveAdmin.register User do
config.form_errors = false
end
```**Disable by default at all resources (change `config/initializers/active_admin.rb`)**
```ruby
ActiveAdmin.setup do
config.form_errors = false
end
```**Show only specific errors**
```ruby
ActiveAdmin.register User do
config.form_errors = lambda do
if current_user.admin?
resource.errors.keys
else
[:name, :email]
end
end
end
```**Change the color base**
```scss
$form-errors-color: red; // must be before the import@import 'active_admin/form_errors';
```## Maintainer
[Dhyego Fernando](https://github.com/dhyegofernando)