Sha256: f7fb040da16c5c66b78a26cd09b9721d257633b74113a95116f6243a71d4d487

Contents?: true

Size: 939 Bytes

Versions: 2

Compression:

Stored size: 939 Bytes

Contents

<%#
# BelongsTo Form Partial

This partial renders an input element for belongs_to relationships.
By default, the input is a collection select box
that displays all possible records to associate with.

## Local variables:

- `f`:
  A Rails form generator, used to help create the appropriate input fields.
- `field`:
  An instance of [Administrate::Field::BelongsTo][1].
  Contains helper methods for displaying a collection select box.

[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/BelongsTo
%>

<div class="field-unit__label">
  <%= f.label field.attribute, for: "#{f.object_name}_#{field.permitted_attribute}" %>
</div>
<div class="field-unit__field">
  <%= f.select(field.permitted_attribute,
               options_for_select(field.associated_resource_options, field.selected_option),
               {include_blank: field.include_blank_option},
               data: {controller: field.html_controller}) %>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
administrate-1.0.0.beta3 app/views/fields/belongs_to/_form.html.erb
administrate-1.0.0.beta2 app/views/fields/belongs_to/_form.html.erb