Sha256: 90b0f1673929f2153a0cf7667fc476c4bc8a9113328ba884cc3f05a457326774

Contents?: true

Size: 680 Bytes

Versions: 45

Compression:

Stored size: 680 Bytes

Contents

<%= edit_field_wrapper field: @field, index: @index, form: @form, resource: @resource, displayed_in_modal: @displayed_in_modal do %>
  <%= @form.select @field.foreign_key, @field.options.map { |o| [o[:label], o[:value]] },
    {
      include_blank: @field.placeholder,
    },
    {
      class: helpers.input_classes('w-full', has_error: @field.model_errors.include?(@field.id)),
      disabled: disabled
    }
    %>
  <%
    # If the select field is disabled, no value will be sent. It's how HTML works.
    # Thus the extra hidden field to actually send the related id to the server.
    if disabled
  %>
    <%= @form.hidden_field @field.foreign_key %>
  <% end %>
<% end %>

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
avo-1.6.4.pre.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.6.3.pre.2 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.6.3.pre.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.6.2.pre.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.6.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.6.0 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.5.5 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.5.4 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.5.3 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.5.2 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.5.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.5.0 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.5.pre.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.4.pre.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.4 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.3 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.2 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.1 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.0 app/components/avo/fields/belongs_to_field/edit_component.html.erb
avo-1.4.0.pre.1 app/components/avo/edit/fields/belongs_to_field_component.html.erb