Sha256: e7a57120b845614bd9ded76674f994eb4f3d5699df3572463ff4b021b0b259f5

Contents?: true

Size: 1011 Bytes

Versions: 3

Compression:

Stored size: 1011 Bytes

Contents

<%
  # name: headmin/forms/fields/list
  #
  # ==== Options
  # * +form+ - Form object
  # * +name+ - Name for the field
  # * +label+ - Text to show as label. Label will be hidden if value is false
  #
  # ==== Examples
  #   Basic version
  #   <%= render "headmin/forms/fields/list", form: form, name: :websites do |list| %#>
  #     <%= render "headmin/forms/fields/text", form: list, name: :url do |field, attribute, label| %#>
  #       <%= render "headmin/forms/text", form: field, attribute: attribute, label: label %#>
  #     <% end %#>
  #   <% end %#>

  label = local_assigns.has_key?(:label) ? label : nil
  show_label = label != false
%>

<%= render "headmin/forms/fields/base", form: form, name: name, field_type: :list do |list, field_label| %>
  <%= render "headmin/forms/repeater", form: list, attribute: :fields, label: show_label ? label || field_label : false, flush: false do |field| %>
    <%= field.hidden_field :field_type, value: :group %>
    <%= yield field %>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
headmin-0.5.3 app/views/headmin/forms/fields/_list.html.erb
headmin-0.5.1 app/views/headmin/forms/fields/_list.html.erb
headmin-0.5.0 app/views/headmin/forms/fields/_list.html.erb