Sha256: 2b72ce93ed7d0487dff617e38be84ee7e85ad87a494c8f01247efd65466f5dc5
Contents?: true
Size: 907 Bytes
Versions: 10
Compression:
Stored size: 907 Bytes
Contents
<% # name: headmin/forms/fields/base # # ==== Options # * <tt>form<tt> - Form object # * <tt>name<tt> - Name for the field # * <tt>field_type<tt> - Type of the field. Options: [:text, :image, :file, :list, :group] # # ==== Examples # Basic version # <%= render 'headmin/forms/fields/base', form: form, field_type: :text, name: name do |field, label| %#> # <%= render "headmin/forms/text", form: field, attribute: :value, label: label %#> # <% end %#> field = form.object.fields.detect { |field| field.name.to_s == name.to_s } field = field ? field : form.object.fields.new(field_type: field_type, name: name) label = t("attributes.#{name.to_s.parameterize}", default: field.name.to_s) %> <%= form.fields_for :fields, field do |ff| %> <%= ff.hidden_field :id %> <%= ff.hidden_field :name %> <%= ff.hidden_field :field_type %> <%= yield ff, label %> <% end %>
Version data entries
10 entries across 10 versions & 1 rubygems