Sha256: 1dcbd757a42872a6113aebee486aa2ab9bb082063de2271ff6fa5a237b644555
Contents?: true
Size: 920 Bytes
Versions: 6
Compression:
Stored size: 920 Bytes
Contents
<%# # HasOne Form Partial This partial renders an input element for has_one relationships. The form will be rendered as nested_from to parent relationship. ## Local variables: - `f`: A Rails form generator, used to help create the appropriate input fields. - `field`: An instance of [Administrate::Field::HasOne][1]. A wrapper around the has_one relationship pulled from the database. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/HasOne %> <%= f.fields_for field.attribute, field.data || field.nested_form.resource.class.new do |has_one_f| %> <fieldset class="field-unit--nested"> <legend><%= field.nested_form.resource_name.titleize %></legend> <% field.nested_form.attributes.each do |attribute| -%> <div class="field-unit field-unit--<%= attribute.html_class %>"> <%= render_field attribute, f: has_one_f %> </div> <% end -%> </fieldset> <% end %>
Version data entries
6 entries across 6 versions & 2 rubygems