Method: CustomTable::ApplicationHelper#custom_table_fields_list_to_definitions

Defined in:
app/helpers/custom_table/application_helper.rb

#custom_table_fields_list_to_definitions(model, fields) ⇒ Object

Gets array of fields and results in object of available fields and definitions from fields from list



491
492
493
494
495
496
497
498
499
# File 'app/helpers/custom_table/application_helper.rb', line 491

def custom_table_fields_list_to_definitions model, fields
  d = custom_table_fields_definition_for(model) 
  out = {}
  fields.each do |f|
    found = d.find {|k, v| k == f }
    out[f] = found[1] if !found.nil?
  end
  return out
end