Sha256: 3a08c701f280a73bc29e43518a0ded7d5608cd6d2e757b80f8052bd95e1a7eec

Contents?: true

Size: 714 Bytes

Versions: 6

Compression:

Stored size: 714 Bytes

Contents

module Hancock
  module Admin
    module EmbeddedElement
      def self.config(nav_label = nil, fields = {})
        if nav_label.is_a?(Hash)
          nav_label, fields = nav_label[:nav_label], nav_label
        elsif nav_label.is_a?(Array)
          nav_label, fields = nil, nav_label
        end

        Proc.new {
          navigation_label(nav_label || I18n.t('hancock.cms'))
          field :enabled, :toggle do
            searchable false
          end
          field :name, :string do
            searchable true
          end

          Hancock::RailsAdminGroupPatch::hancock_cms_group(self, fields)

          if block_given?
            yield self
          end
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hancock_cms-1.0.1 lib/hancock/admin/embedded_element.rb
hancock_cms-2.0.0.2 lib/hancock/admin/embedded_element.rb
hancock_cms-1.0.0.4 lib/hancock/admin/embedded_element.rb
hancock_cms-1.0.0.3 lib/hancock/admin/embedded_element.rb
hancock_cms-2.0.0.1 lib/hancock/admin/embedded_element.rb
hancock_cms-1.0.0.2 lib/hancock/admin/embedded_element.rb