From 7b48f8af08836cfc09c656522dd2b8c1b4ead114 Mon Sep 17 00:00:00 2001 From: Mattia Roccoberton Date: Thu, 17 Sep 2020 13:59:56 +0200 Subject: [PATCH] v0.3.0 --- README.md | 11 ++++++++--- lib/activeadmin/dynamic_fields/version.rb | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eaf2b18..0f4f40f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # ActiveAdmin Dynamic Fields [![Gem Version](https://badge.fury.io/rb/activeadmin_dynamic_fields.svg)](https://badge.fury.io/rb/activeadmin_dynamic_fields) [![CircleCI](https://circleci.com/gh/blocknotes/activeadmin_dynamic_fields.svg?style=svg)](https://circleci.com/gh/blocknotes/activeadmin_dynamic_fields) -An Active Admin plugin to add dynamic behaviors to fields. +An Active Admin plugin to add dynamic behaviors to some fields. Features: - set conditional checks on fields -- trigger some actions on other fields +- trigger actions on target elements - inline field editing - create links to load some content in a dialog @@ -14,7 +14,10 @@ The easiest way to show how this plugin works is looking the examples [below](#e - Add to your Gemfile: `gem 'activeadmin_dynamic_fields'` - Execute bundle - Add at the end of your ActiveAdmin javascripts (_app/assets/javascripts/active_admin.js_): -`//= require activeadmin/dynamic_fields` + +```js +//= require activeadmin/dynamic_fields +``` ## Options Options are passed to fields using *input_html* parameter as *data* attributes: @@ -38,6 +41,8 @@ Options are passed to fields using *input_html* parameter as *data* attributes: - **data-function**: check the return value of a custom function - **data-arg**: argument passed to the custom set function (as array of strings) +A check condition or a custom check function are required. A trigger action is required too, unless you are using a custom function (in that case it is optional). + ## Examples ### Dynamic fields examples diff --git a/lib/activeadmin/dynamic_fields/version.rb b/lib/activeadmin/dynamic_fields/version.rb index 80aaf9c..3b47077 100644 --- a/lib/activeadmin/dynamic_fields/version.rb +++ b/lib/activeadmin/dynamic_fields/version.rb @@ -2,6 +2,6 @@ module ActiveAdmin module DynamicFields - VERSION = '0.2.10' + VERSION = '0.3.0' end end