jeudi 1 décembre 2022

how to add extra value to query in ruby

hello i have query to fill list box with this query how i can add an static value to select all clients

tipo = $evm.root['dialog_param_type']
option = $evm.root['dialog_param_action']
dialog_field = $evm.object
if tipo == "ALL"
  puts option
  dialog_field['read_only'] = "true"
  $evm.object['values'] = {1 => "-- Please select an option from above --"}
else
  puts option
  dialog_field['read_only'] = "false"
  values= {}
  customer_list= {}

  get_query($evm.object.decrypt('query')).each do |$evm.object['values'] = {1 => "-- Please select an option from above --"}|item|
    customer_list["#{item['customer_id']}", Customer id: *] = item['customer_name'].to_s
  end
  dialog_field['values'] = customer_list
end

it fills it with clients on my db; so i wanted to add an option to select them all like aditional value values= {ALL=> *}}

Aucun commentaire:

Enregistrer un commentaire