Sha256: e4861118411d17b5e549d75db95bb4bf65740a876bcdca7bbbf4b49ee3a934c1
Contents?: true
Size: 916 Bytes
Versions: 1
Compression:
Stored size: 916 Bytes
Contents
ActiveAdmin.register KnowledgeBase::Sectionables::Gallery do menu parent: I18n.t('activerecord.models.knowledge_base/section/kind.other') index do column :id column :title column :description default_actions end form do |f| f.inputs do f.input :title f.input :description f.input :style f.has_many :images, sortable: :position do |f| f.input :caption image_hint = f.object.new_record? ? nil : f.template.image_tag(f.object.image.medium) f.input :image, hint: image_hint f.input :_destroy, as: :boolean, label: I18n.t('destroy') end end f.actions end show do |gallery| attributes_table do row :id row :title row :description row :images do gallery.images.map do |image| image_tag(image.image.medium) end.join(" ").html_safe end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
knowledge_base-0.2.0 | lib/generators/knowledge_base/active_admin/templates/sectionables/gallery.rb |