module Rack::App::FrontEnd::Helpers::Table

Public Instance Methods

table_by(object, attributes={}) click to toggle source
# File lib/rack/app/front_end/helpers/table.rb, line 50
def table_by(object, attributes={})
  if object.is_a?(Array) && object.all? { |e| e.is_a?(Hash) }
    Builder.from_array_of_hash(object, attributes)
  elsif object.is_a?(Hash)
    Builder.from_hash(object, attributes)
  else
    raise("don't know how to build table from this: #{object}")
  end
end