administrate-field-nested_has_many 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -2
- data/lib/administrate/field/nested_has_many.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cb29d90820122048ad397c50a5f663381a06975
|
4
|
+
data.tar.gz: f0f0d555baa0f4f2dc0e414b509cb415e1bb74c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a07b34b7debeba156a264e191b0b7d4ab054519ee12fd71d536b3e50fbd68536050f49cc5e7375c802a9f68900195bf6f3167b620bbedcaa035c8c517d7b6ed5
|
7
|
+
data.tar.gz: ca68e9204dfcc2e472ec7e1da8d5039b1bcbc11e3d90b80f3dc0fc37c6d2bf48d04d440e343ac6dc1c611776ffb29002e0f2a7e3e75303674058b3369b2b2dd5
|
data/README.md
CHANGED
@@ -7,13 +7,13 @@ A plugin for nested has_many forms in [Administrate].
|
|
7
7
|
Add to your `Gemfile`:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem "administrate-field-nested_has_many"
|
10
|
+
gem "administrate-field-nested_has_many", "~> 0.0.2"
|
11
11
|
```
|
12
12
|
|
13
13
|
Run:
|
14
14
|
|
15
15
|
```bash
|
16
|
-
$bundle install
|
16
|
+
$ bundle install
|
17
17
|
```
|
18
18
|
|
19
19
|
Add to your `FooDashboard`:
|
@@ -34,4 +34,20 @@ Otherwise, Administrate will try to render a field
|
|
34
34
|
for the order's `:customer` attribute,
|
35
35
|
which breaks the nested form logic.
|
36
36
|
|
37
|
+
## Stopgap fix for javascript
|
38
|
+
|
39
|
+
At the moment, Administrate doesn't automatically load javascripts from plugins.
|
40
|
+
To fix this, you need to generate the Administrate javascript file:
|
41
|
+
|
42
|
+
```bash
|
43
|
+
$ rails g administrate:views:layout
|
44
|
+
```
|
45
|
+
|
46
|
+
And then add a line to `app/views/admin/application/_javascript.html.erb`
|
47
|
+
to input the javascript for this gem:
|
48
|
+
|
49
|
+
```
|
50
|
+
<%= javascript_include_tag "administrate-field-nested_has_many/application" %>
|
51
|
+
```
|
52
|
+
|
37
53
|
[Administrate]: https://github.com/thoughtbot/administrate
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require "administrate/field/has_many"
|
2
2
|
require "administrate/page/form"
|
3
3
|
require "rails"
|
4
|
+
require "cocoon"
|
4
5
|
|
5
6
|
module Administrate
|
6
7
|
module Field
|
7
8
|
class NestedHasMany < Administrate::Field::HasMany
|
8
|
-
VERSION = "0.0.
|
9
|
+
VERSION = "0.0.2"
|
9
10
|
|
10
11
|
class Engine < ::Rails::Engine
|
11
12
|
end
|