module ActiveScaffold::DataStructures class Column module ProxyableMethods extend ActiveSupport::Concern included do # rubocop:disable Metrics/BlockLength # Whether to enable inplace editing for this column. Currently works for text columns, in the List. attr_reader :inplace_edit # :table to refresh list # true or :row to refresh row attr_accessor :inplace_edit_update # Whether this column set is collapsed by default in contexts where collapsing is supported attr_accessor :collapsed # Whether to enable add_existing for this column attr_accessor :allow_add_existing # What columns load from main table attr_accessor :select_columns # define a calculation for the column. anything that ActiveRecord::Calculations::ClassMethods#calculate accepts will do. attr_accessor :calculate # A placeholder text, to be used inside blank text fields to describe, what should be typed in attr_accessor :placeholder # this will be /joined/ to the :name for the td's class attribute. useful if you want to style columns on different ActiveScaffolds the same way, but the columns have different names. attr_accessor :css_class # whether the field is required or not. used on the form for visually indicating the fact to the user. attr_writer :required # the display-name of the column. this will be used, for instance, as the column title in the table and as the field name in the form. # if left alone it will utilize human_attribute_name which includes localization attr_writer :label # a textual description of the column and its contents. this will be displayed with any associated form input widget, so you may want to consider adding a content example. attr_writer :description attr_reader :update_columns # send all the form instead of only new value when this column changes attr_accessor :send_form_on_update_column # add a custom attr_accessor that can contain a Proc (or boolean or symbol) # that will be called when the column renders, such that we can dynamically # hide or show the column with an element that can be replaced by # update_columns, but won't affect the form submission. # The value can be set in the scaffold controller as follows to dynamically # hide the column based on a Proc's output: # config.columns[:my_column].hide_form_column_if = Proc.new { |record, column, scope| record.vehicle_type == 'tractor' } # OR to always hide the column: # config.columns[:my_column].hide_form_column_if = true # OR to call a method on the record to determine whether to hide the column: # config.columns[:my_column].hide_form_column_if = :hide_tractor_fields? attr_accessor :hide_form_column_if # a collection of columns to load from the association when eager loading is disabled, if it's nil all columns will be loaded attr_accessor :select_associated_columns # to modify the default order of columns attr_accessor :weight attr_accessor :associated_limit attr_writer :associated_number # what string to use to join records from plural associations attr_accessor :association_join_text attr_writer :show_blank_record attr_accessor :actions_for_association_links attr_writer :number # supported options: # * for association columns # * :select - displays a simple