Sha256: 8b2d9e8ba5c03a27978b2b4796e4376dd80f1eefc8bd0c8dffc0ec9b2f6d97eb
Contents?: true
Size: 828 Bytes
Versions: 27
Compression:
Stored size: 828 Bytes
Contents
module DynamicScaffold module List class Item attr_reader :classnames, :html_attributes def initialize(config, *args, block) @config = config @html_attributes = args.extract_options! @classnames = @html_attributes.delete(:class) @attribute_name = args[0] @block = block end def value(view, record) if @block view.instance_exec(record, @attribute_name, &@block) else record.public_send(@attribute_name) end end def label(label = nil, &block) @block = block if block if label @label = label self elsif @label @label elsif @attribute_name @config.model.human_attribute_name @attribute_name end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems