Sha256: f6b6ac052adba6d207f3c23a2582fd0920c909f15b4548731f94bd05aa2a2bcd
Contents?: true
Size: 1.36 KB
Versions: 10
Compression:
Stored size: 1.36 KB
Contents
<% # name: headmin/forms/file # # ==== Options # * <tt>form<tt> - Form object # * <tt>attribute<tt> - Name of the attribute of the form model # * <tt>label<tt> - Text to show as label. Label will be hidden if value is false # # ==== Examples # Basic version # <%= render 'headmin/forms/image', form: form, attribute: :image %#> class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false data = local_assigns.has_key?(:data) ? data : nil disabled = local_assigns.has_key?(:disabled) ? disabled : false label = local_assigns.has_key?(:label) ? label : nil readonly = local_assigns.has_key?(:readonly) ? readonly : false required = local_assigns.has_key?(:required) ? required : false options = { 'aria-describedby': form_field_validation_id(form, attribute), class: "form-control #{form_field_validation_class(form, attribute)} #{class_names}", data: data, disabled: disabled, placeholder: attribute, readonly: readonly, required: required, } show_label = label != false %> <div class="<%= ('mb-3 text-start' if show_label) %>"> <% if show_label %> <%= render 'headmin/forms/label', form: form, attribute: attribute, name: label, required: required %> <% end %> <%= form.file_field(attribute, options) %> <%= render 'headmin/forms/validation', form: form, attribute: attribute %> </div>
Version data entries
10 entries across 10 versions & 1 rubygems