<% base_class = "select-input".freeze # Optional props disabled = local_assigns.fetch(:disabled, false) id = local_assigns.fetch(:id, nil) label = local_assigns.fetch(:label, false) selected = local_assigns.fetch(:selected, nil) classes = local_assigns.fetch(:classes, []) # Classes class_names = classes.push(base_class).join(" ") %>
<% if label %> <% end %> <%= select_tag( name, options_for_select(options, selected), disabled: disabled ) %>