Sha256: 39f5825a68514a8c636de0402e1d636d7642a5cc6645ab2ee169b9bb93b7d4b6

Contents?: true

Size: 1.43 KB

Versions: 15

Compression:

Stored size: 1.43 KB

Contents

<% yield %>

<%
form ||= current_fields_form
html_options ||= {}
html_options[:id] ||= id_for(form, method)
multiple ||= false
other_options ||= {}
options ||= options_for(form, method)
labels = labels_for(form, method)
%>

<%= render 'shared/fields/field', form: form, method: method, options: html_options, other_options: other_options do %>
  <% content_for :field do %>
    <div class="pt-1.5 pb-1 sm:col-span-2">
      <div class="max-w-lg space-y-3">

        <% options.each do |value, label| %>

          <label class="relative flex items-start">
            <div class="flex items-center h-5">

              <% if multiple %>
                <%= form.check_box method, {multiple: multiple, checked: form.object.send(method).map(&:to_s).include?(value.to_s), class: "focus:ring-blue h-4 w-4 text-blue border-gray-300 rounded"}, value, "" %>
              <% else %>
                <%= form.radio_button method, value, {class: "focus:ring-blue h-4 w-4 text-blue border-gray-300"} %>
              <% end %>

            </div>
            <div class="ml-2.5 text-sm">
              <div class="select-none"><%= label %></div>
              <% if labels.options_help&.dig(value)&.present? %>
                <p class="mt-0.5 text-xs text-gray-500">
                  <%= labels.options_help.dig(value) %>
                </p>
              <% end %>
            </div>
          </label>

        <% end %>

      </div>
    </div>
  <% end %>
<% end %>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bullet_train-themes-tailwind_css-1.0.14 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.13 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.12 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.11 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.10 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.9 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.8 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.7 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.6 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.5 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.4 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.3 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.2 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.1 app/views/themes/tailwind_css/fields/_options.html.erb
bullet_train-themes-tailwind_css-1.0.0 app/views/themes/tailwind_css/fields/_options.html.erb