<%= label_tag var, var %>
<% if (data = @smart_vars[var]) %>
<%= select_tag var, options_for_select([[nil, nil]] + data, selected: var_params[var]), data: { controller: "selectize" }, style: "margin-right: 20px; width: 200px; display: none;" %>
<% elsif var.end_with?("_at") || var == "start_time" || var == "end_time" %>
<%= hidden_field_tag var, var_params[var], data: { datepicker_target: "input" } %>
Select a date
<% else %>
<%= text_field_tag var, var_params[var], autofocus: i == 0 && !var.end_with?("_at") && !var_params[var], class: "form-control" %>
<% end %>