Skip to content

Commit d45ba6b

Browse files
Mattia Roccobertonblocknotes
authored andcommitted
Add Webpacker instructions
1 parent 60b31d5 commit d45ba6b

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,29 @@ Please :star: if you like it.
1515

1616
## Install
1717

18-
- Add to your Gemfile: `gem 'activeadmin_dynamic_fields'`
19-
- Execute bundle
20-
- Add at the end of your ActiveAdmin javascripts (_app/assets/javascripts/active_admin.js_):
18+
First, add the gem to your ActiveAdmin project: `gem 'activeadmin_dynamic_fields'` (and execute `bundle`)
19+
20+
If you installed Active Admin **without Webpacker** support:
21+
- add at the end of your ActiveAdmin javascripts (_app/assets/javascripts/active_admin.js_):
2122

2223
```js
2324
//= require activeadmin/dynamic_fields
2425
```
2526

27+
Otherwise **with Webpacker**:
28+
29+
- Execute in your project root:
30+
31+
```sh
32+
yarn add blocknotes/activeadmin_dynamic_fields
33+
```
34+
35+
- Add to your *app/javascript/packs/active_admin.js*:
36+
37+
```js
38+
require('activeadmin_dynamic_fields')
39+
```
40+
2641
## Options
2742

2843
Options are passed to fields using *input_html* parameter as *data* attributes.

0 commit comments

Comments
 (0)