Sha256: 41c934ae79d0991e152e64c48d4e86867fefb104d690d3264cd2d3f6a2c03946
Contents?: true
Size: 853 Bytes
Versions: 3
Compression:
Stored size: 853 Bytes
Contents
<%# # Enum Form Partial This partial renders an input element for enum attributes. By default, the input is a select field for the enum attributes. ## Local variables: - `f`: A Rails form generator, used to help create the appropriate input fields. - `field`: An instance of [Administrate::Field::Enum][1]. A wrapper around the enum attributes pulled from the model. %> <div class="field-unit__label"> <%= f.label field.attribute %> </div> <div class="field-unit__field"> <%= f.select( field.attribute, options_for_select( f.object.class.public_send(field.attribute.to_s.pluralize).map do |k, v| [I18n.t("activerecord.attributes.#{f.object.class.name.underscore}.#{field.attribute.to_s.pluralize}.#{k}", default: k.humanize), k] end, f.object.public_send(field.attribute.to_s) ), include_blank: false) %> </div>
Version data entries
3 entries across 3 versions & 1 rubygems