Sha256: 1c0a79c70e5f2b1ae807cbafae043f78382289176569086094cfab89afb4b54e

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

<fieldset class="nested_fieldset <%= association %>">
  <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

1 entries across 1 versions & 1 rubygems

Version Path
nested_fields-0.3.0 app/views/nested_fields/_singular_nested_fieldset.html.erb