Sha256: 3fddb8e78ad8e0a31920830afee72af03cf48fbade58a38cd7a2725a364dd1ce

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

<fieldset class="nested_fieldset">
  <legend><%= local_assigns[:legend] || association.to_s.titleize %></legend>

  <%= yield %>

  <%= f.fields_for association, associate, :builder => f.class do |nested_f| %>
    <label class="nested_one_label">
      <%= check_box_tag "has_#{association}", nil, !local_assigns[:has_zero], :class => :nested_fields_has_one %>
      Has <%= association.to_s.titleize %>?
    </label>

    <%= nested_f.hidden_field :_destroy, :class => :destroy_nested_one, :value => local_assigns[:has_zero] ? 'true' : 'false' %>

    <%= content_tag :div, :class => :nested_one, :style => ('display:none' if local_assigns[:has_zero]) do %>
      <%= render nested_partial, :f => nested_f %>
    <% end %>
  <% end %>
</fieldset>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nested_fields-0.2.2 app/views/nested_fields/_singular_nested_fieldset.html.erb
nested_fields-0.2.1 app/views/nested_fields/_singular_nested_fieldset.html.erb