Sha256: 26ba2204ebad45ad21682d879ec47c6551bceee4184bc911ba75edea4fb12e8e

Contents?: true

Size: 883 Bytes

Versions: 1

Compression:

Stored size: 883 Bytes

Contents

<% first_attachments = true

   name_attribute = attributes.delete_if {|attr| attr.name == 'name'}
   # Assumes every content block should always have a name attribute
-%><%%= f.input :name, as: :cms_text_field %>
<% for attribute in attributes -%>
<%= field_tag = case attribute.type
        when :attachment
          "input :#{attribute.name}, as: :file_picker"
        when :attachments
          if first_attachments
            first_attachments = false
            "cms_attachment_manager"
          end
        when :category
          "association :#{attribute.name}, collection: categories_for('#{class_name.titleize}')"
        when :date
          "input :#{attribute.name}, as: :date_picker"
        when :html
          "input :#{attribute.name}, as: :text_editor"
        else
          "input :#{attribute.name}"
        end

   "<%= f.#{field_tag} %%>"
%>
<% end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
browsercms-4.0.0.alpha lib/generators/cms/content_block/templates/_form.html.erb