Class: AbAdmin::Config::Show

Inherits:
BaseBuilder show all
Defined in:
lib/ab_admin/config/base.rb

Instance Attribute Summary

Attributes inherited from BaseBuilder

#fields, #options, #partial

Class Method Summary collapse

Methods inherited from BaseBuilder

#field, #initialize

Constructor Details

This class inherits a constructor from AbAdmin::Config::BaseBuilder

Class Method Details

.default_for_model(model, options = {}) ⇒ Object


67
68
69
70
71
72
73
74
75
# File 'lib/ab_admin/config/base.rb', line 67

def self.default_for_model(model, options={})
  new.tap do |builder|
    model.new.attributes.each_key do |attr|
      column_name = attr.to_sym
      next if options[:skip].try(:include?, column_name)
      builder.field(column_name)
    end
  end
end