class ActiveAdmin::Views::Column
def build(options = {})
-
options
(Hash
) -- An options hash for the column
def build(options = {}) options = options.dup @span_size = options.delete(:span) || 1 @max_width = options.delete(:max_width) @min_width = options.delete(:min_width) super(options) end
def set_column_styles(column_width, margin_width, is_last_column = false)
def set_column_styles(column_width, margin_width, is_last_column = false) column_with_span_width = (span_size * column_width) + ((span_size - 1) * margin_width) styles = [] styles << "width: #{column_with_span_width}%;" if max_width styles << "max-width: #{max_width};" end if min_width styles << "min-width: #{min_width};" end styles << "margin-right: #{margin_width}%;" unless is_last_column set_attribute :style, styles.join(" ") end