Sha256: 14404066be9dd5c689addfde28f1de39cd833a3ef08727ac85b0d399e4d8c7c7
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
# IntrospectiveAdmin IntrospectiveAdmin is a Rails Plugin for DRYing up ActiveAdmin configurations by laying out simple defaults and including nested relations according to the models' accepts_nested_attributes_for :relation declarations. ## Documentation In your Gemfile: ``` gem 'introspective_admin', git: 'https://github.com/buermann/introspective_admin.git' ``` And bundle install. ``` class MyAdmin < IntrospectiveAdmin::Base def self.exclude_params %w(fields to exclude from the admin screen) end register MyModel do # Add additional ActiveAdmin configuration options under the Admin::MyModelController namespace. end end ``` Customizing select box options for associations is done by adding an "options_for_X" class method on the administrated model: ``` class MyModel < ActiveRecord::Base belongs_to :parent has_many :other_models accepts_nested_attributes_for :other_models, :allow_destroy => true def self.options_for_parent(instance_of_my_model) Parent.order(:appelation).map.{|p| ["#{p.appelation}", p.id] } end end ``` ## Dependencies Tool | Description --------------------- | ----------- [ActiveAdmin] | The current master branch or, when it's released, version >1.0 [ActiveAdmin]: https://github.com/activeadmin
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
introspective_admin-0.0.1 | README.md |