Skip to content

iwasaki-d/administrate-field-nested_has_many

 
 

Repository files navigation

Administrate::Field::NestedHasMany

A plugin for nested has_many forms in Administrate.

Usage

Add to your Gemfile:

gem "administrate-field-nested_has_many", "~> 0.0.2"

Run:

$ bundle install

Add to your FooDashboard:

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.

About

A plugin for nested has_many forms in Administrate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Ruby 53.1%
  • HTML 46.5%
  • JavaScript 0.4%