always show create
what string to use to join records from plural associations
overwrite the includes used for the count sql query
what string to use when a field is empty
if list view is nested hide nested_column
the label for this List action. used for the header.
might be set to open nested_link automatically in view conf.nested.add_link(:players) conf.list.nested_auto_open = {:players => 2} will open nested players view if there are 2 or less records in parent
how many page links around current page to show
how many page links around current page to show
What kind of pagination to use:
true: The usual pagination
:infinite: Treat the source as having an infinite number of pages (i.e. don’t count the records; useful for large tables where counting is slow and we don’t really care anyway)
false: Disable pagination
how many rows to show at once
the ActionLink to reset search
show a link to reset the search next to filtered message
wrap normal cells (not inplace editable columns or with link) with a tag it allows for more css styling
# File lib/active_scaffold/config/list.rb, line 169 def always_show_create @always_show_create && @core.actions.include?(:create) end
# File lib/active_scaffold/config/list.rb, line 158 def always_show_search @always_show_search && !search_partial.blank? end
provides access to the list of columns specifically meant for the Table to use
# File lib/active_scaffold/config/list.rb, line 89 def columns self.columns = @core.columns._inheritable unless @columns # lazy evaluation @columns end
# File lib/active_scaffold/config/list.rb, line 153 def filtered_message @filtered_message ? @filtered_message : :filtered end
# File lib/active_scaffold/config/list.rb, line 175 def hide_nested_column @hide_nested_column.nil? ? true : @hide_nested_column end
# File lib/active_scaffold/config/list.rb, line 143 def label @label ? as_(@label, :count => 2) : @core.label(:count => 2) end
# File lib/active_scaffold/config/list.rb, line 148 def no_entries_message @no_entries_message ? @no_entries_message : :no_entries end
# File lib/active_scaffold/config/list.rb, line 105 def page_links_window=(value) ActiveSupport::Deprecation.warn("Use page_links_inner_window", caller(1)) self.page_links_inner_window = value end
# File lib/active_scaffold/config/list.rb, line 162 def search_partial return "search" if @core.actions.include?(:search) return "field_search" if @core.actions.include?(:field_search) end
# File lib/active_scaffold/config/list.rb, line 134 def sorting @sorting ||= ActiveScaffold::DataStructures::Sorting.new(@core.columns) end
the default sorting. should be an array of hashes of {column_name => direction}, e.g. [{:a => ‘desc’}, {:b => ‘asc’}]. to just sort on one column, you can simply provide a hash, though, e.g. {:a => ‘desc’}.
# File lib/active_scaffold/config/list.rb, line 129 def sorting=(val) val = [val] if val.is_a? Hash sorting.clear val.each { |clause| sorting.add *Array(clause).first } end
# File lib/active_scaffold/config/list.rb, line 5 def initialize(core_config) super # inherit from global scope # full configuration path is: defaults => global table => local table @per_page = self.class.per_page @page_links_inner_window = self.class.page_links_inner_window @page_links_outer_window = self.class.page_links_outer_window # originates here @sorting = ActiveScaffold::DataStructures::Sorting.new(@core.columns) @sorting.set_default_sorting(@core.model) # inherit from global scope @empty_field_text = self.class.empty_field_text @association_join_text = self.class.association_join_text @pagination = self.class.pagination @show_search_reset = self.class.show_search_reset @reset_link = self.class.reset_link.clone @wrap_tag = self.class.wrap_tag @always_show_search = self.class.always_show_search @always_show_create = self.class.always_show_create end
# File lib/active_scaffold/config/list.rb, line 43 def page_links_window=(value) ActiveSupport::Deprecation.warn("Use page_links_inner_window", caller(1)) self.page_links_inner_window = value end