app/helpers/table_builder_helper.rb
# TODO: rename this after migration from `table_builder`
rename this after migration from `table_builder`
rename this after migration from ` table_builder `
def table_builder_2(
    collection,
    columns,
    sortable: true,
    selectable: false,
    links: [],
    cls: '',
    overhead: [],
    model: nil,
    action: nil
  )
    content_tag :table,
      thead(collection, columns, sortable, selectable, links.any?, overhead, model || collection.model, action || params[:action]) +
        tbody(collection, columns, selectable, links, overhead, model, action || params[:action]),
      class: cls
  end
def table_builder_2 ( collection , columns , sortable : true , selectable : false , links : [ ] , cls : '' , overhead : [ ] , model : nil , action : nil ) content_tag :table , thead ( collection , columns , sortable , selectable , links . any? , overhead , model || collection . model , action || params [ :action ] ) + tbody ( collection , columns , selectable , links , overhead , model , action || params [ :action ] ) , class : cls end
TODO: rename this after migration from `table_builder`
TODO : rename this after migration from ` table_builder `
# An `ActiveRecord::Relation`, wrapped in a decorator to provide a list of # `Link` objects via an `#action_links` method # An array of `TableBuilderHelper::Column`s # When false, no columns will be sortable # When true, adds a column of checkboxes to the left side of the table # A set of controller actions that will be added as links to the top of the # gear menu # A CSS class to apply to the <table> # A set of content, over the th line... # Possibility to override the result of collection.model #overrides the params[:action] value
collection
columns
sortable
selectable
links
cls
overhead
model
action