module TableHelp::Helper

Public Instance Methods

attributes_table_for(collection_or_resource, options = {})
Alias for: table_for
table_for(collection_or_resource, options = {}) { |this| ... } click to toggle source
# File lib/table_help/helper.rb, line 3
def table_for(collection_or_resource, options = {})
  resolve_builder_from(collection_or_resource, options).tap { |this| yield this }.to_html
end
Also aliased as: attributes_table_for

Private Instance Methods

resolve_builder_from(collection_or_resource, options) click to toggle source
# File lib/table_help/helper.rb, line 11
def resolve_builder_from(collection_or_resource, options)
  if collection_or_resource.respond_to?(:to_model)
    AttributesTableFor.new(collection_or_resource, self, options)
  else
    TableFor.new(collection_or_resource, self, options)
  end
end