Sha256: ef6c00cd7454d091ffd6aeb691e51d8d47264ada31cc582a76f793135aad71dd

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

class SunriseFormatItem < Sunrise::AbstractModel
  self.resource_name = 'Formats::Item'

  available_index_views [:thumbs]

  index :thumbs do
    scope { Formats::Item.includes(:icon) }
    preview ->(record) { record.icon.try(:url, :thumb) }

    field :title
    field :notes

    group :search do
      field :title
      field :category_id, collection: -> { Formats::Category.all }
    end
  end

  form do
    field :title, as: :text, input_html: { rows: 1, style: 'width:800px;' }
    field :notes, as: :text, input_html: { rows: 2, style: 'width:800px;' }

    field :category_id, collection: -> { Formats::Category.all }, include_blank: false

    field :icon, as: :uploader
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/sunrise/sunrise_format_item.rb