README.md in activeadmin_selectize-0.1.0 vs README.md in activeadmin_selectize-0.1.2

- old
+ new

@@ -4,26 +4,28 @@ Features: - nice select inputs - items search - AJAX content loading +- improve many-to-many / one-to-many selection ## Install -- Add to your Gemfile (also add _jquery-rails_ or include jQuery manually): +- Add to your Gemfile: `gem 'activeadmin_selectize'` +- Add _jquery-rails_ gem or include jQuery manually - Execute bundle - Add at the end of your ActiveAdmin styles (_app/assets/stylesheets/active_admin.scss_): `@import 'activeadmin/selectize_input';` - Add at the end of your ActiveAdmin javascripts (_app/assets/javascripts/active_admin.js_): ```css //= require activeadmin/selectize/selectize //= require activeadmin/selectize_input ``` - Use the input with `as: :selectize` in Active Admin model conf -Why 2 separated scripts? In this way you can include a different version of selectize.js if you like. +Why 2 separated scripts? In this way you can include a different version of Selectize.js if you like. ## Example Example 1: an Article model with a many-to-many relation with Tag model: @@ -52,10 +54,14 @@ Pass the required options using `input_html`. - **data-opt-remote**: URL used for AJAX search requests (method GET) - **data-opt-text**: field to use as option label - **data-opt-value**: field to use as select value -- **data-opt-...**: option passed directly to Selectize.js - see [options](https://github.com/selectize/selectize.js/blob/master/docs/usage.md#configuration) +- **data-opt-NAME**: option _NAME_ passed directly to Selectize.js - see [options](https://github.com/selectize/selectize.js/blob/master/docs/usage.md#configuration) + +Alternative syntax: + +- **data-options**: overrides Selectize options - example: `'data-options': '{"highlight":true,"plugins":[]}'` ## Contributors - [Mattia Roccoberton](http://blocknot.es) - creator, maintainer