lib/generators/dry_crud/templates/app/helpers/list_helper.rb
def list_table(*attrs, &block)
    options = attrs.extract_options!
    # only use default attrs if no attrs and no block are given
    attributes = (block_given? || attrs.present?) ? attrs : default_attrs
    table(entries, options) do |t|
      t.sortable_attrs(*attributes)
      yield t if block_given?
    end
  end
# Create a table of the entries with the default or
# the passed attributes in its columns. An options hash may be given
# as the last argument.
Create a table of the entries with the default or
the passed attributes in its columns. An options hash may be given
as the last argument.
Create a table of the entries with the default or the passed attributes in its columns . An options hash may be given as the last argument .
def list_table(*attrs, &block)
    options = attrs.extract_options!
    attributes = (block_given? || attrs.present?) ? attrs : default_attrs
    table(entries, options) do |t|
      t.sortable_attrs(*attributes)
      yield t if block_given?
    end
  end
def list_table ( * attrs , & block ) options = attrs . extract_options! attributes = ( block_given? || attrs . present? ) ? attrs : default_attrs table ( entries , options ) do | t | t . sortable_attrs ( * attributes ) yield t if block_given? end end
Create a table of the entries with the default or
the passed attributes in its columns.
Create a table of the entries with the default or the passed attributes in its columns .
# only use default attrs if no attrs and no block are given
attrs
block