lib/ab_admin/config/base.rb in ab_admin-0.3.6 vs lib/ab_admin/config/base.rb in ab_admin-0.4.0
- old
+ new
@@ -55,10 +55,14 @@
def locale_tabs(options={}, &block)
@fields << FieldGroup.new(options.update(localized: true), &block)
end
end
+ class ModalForm < Form
+ self.partial_name = 'modal_form'
+ end
+
class Show < BaseBuilder
self.partial_name = 'show_table'
def self.default_for_model(model, options={})
new.tap do |builder|
@@ -84,15 +88,19 @@
true
end
end
class Field
- attr_reader :name, :options, :data
+ attr_reader :name, :options, :block
def initialize(name, options={}, &block)
@name = name
@options = options
- @data = block_given? ? block : name.to_sym
+ @block = block
+ end
+
+ def data
+ @block || name.to_sym
end
def group?
false
end
\ No newline at end of file