Sha256: 4a3ecd9bbabadaaef1977404607b523bc2008d8ceb1b76637ff7c7e0256d5ce1

Contents?: true

Size: 878 Bytes

Versions: 14

Compression:

Stored size: 878 Bytes

Contents

# Administrate::Field::NestedHasMany

A plugin for nested has_many forms in [Administrate].

## Usage

Add to your `Gemfile`:

```ruby
gem "administrate-field-nested_has_many"
```

Run:

```bash
$ bundle install
```

Add to your `FooDashboard`:

```ruby
ATTRIBUTE_TYPES = {
  bars: Field::NestedHasMany.with_options(skip: :foo),
}
```

The `skip` option takes a single symbol or list of symbols.
It will prevent the nested form from displaying the fields for those attributes.

If a `Customer` `has_many :orders`,
and you want to render `orders` as a nested form on the customer edit page,
then it is generally necessary to add `skip: :customer` to the options
for the `NestedHasMany` field.
Otherwise, Administrate will try to render a field
for the order's `:customer` attribute,
which breaks the nested form logic.

[Administrate]: https://github.com/thoughtbot/administrate

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
viniBaxter-spa-nested_has_many-300.0.6 README.md
viniBaxter-spa-nested_has_many-300.0.5 README.md
viniBaxter-spa-nested_has_many-300.0.4 README.md
viniBaxter-spa-nested_has_many-300.0.2 README.md
viniBaxter-spa-nested_has_many-300.0.1 README.md
viniBaxter-spa-nested_has_many-5.4.0 README.md
viniBaxter-spa-nested_has_many-5.0.1 README.md
viniBaxter-spa-nested_has_many-5.0.0 README.md
administrate-field-nested_has_many-1.3.0 README.md
viniBaxter-spa-nested_has_many-4.0.0 README.md
viniBaxter-spa-nested_has_many-3.0.0 README.md
viniBaxter-spa-nested_has_many-2.0.0 README.md
administrate-field-nested_has_many-1.2.0 README.md
administrate-field-nested_has_many-1.1.0 README.md