Sha256: 609a812f76d9a3323e906baaa1aaa00d8dbe2f0e1f563da5426a4add5ae59022

Contents?: true

Size: 1.26 KB

Versions: 15

Compression:

Stored size: 1.26 KB

Contents

require "administrate/base_dashboard"

class Foo::StudentDashboard < Administrate::BaseDashboard
  # ATTRIBUTE_TYPES
  # a hash that describes the type of each of the model's fields.
  #
  # Each different type represents an Administrate::Field object,
  # which determines how the attribute is displayed
  # on pages throughout the dashboard.
  ATTRIBUTE_TYPES = {
    school: Field::BelongsTo,
    id: Field::Number,
    name: Field::String,
    created_at: Field::DateTime,
    updated_at: Field::DateTime,
  }.freeze

  # COLLECTION_ATTRIBUTES
  # an array of attributes that will be displayed on the model's index page.
  #
  # By default, it's limited to four items to reduce clutter on index pages.
  # Feel free to add, remove, or rearrange items.
  COLLECTION_ATTRIBUTES = [
    :school,
    :id,
    :name,
    :created_at,
  ].freeze

  # SHOW_PAGE_ATTRIBUTES
  # an array of attributes that will be displayed on the model's show page.
  SHOW_PAGE_ATTRIBUTES = [
    :school,
    :id,
    :name,
    :created_at,
    :updated_at,
  ].freeze

  # FORM_ATTRIBUTES
  # an array of attributes that will be displayed
  # on the model's form (`new` and `edit`) pages.
  FORM_ATTRIBUTES = [
    :school,
    :name,
  ].freeze

  def display_resource(student)
    student.name
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
administrate-field-nested_has_many-2.1.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
administrate-field-nested_has_many-2.0.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-300.0.6 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-300.0.5 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-300.0.4 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-300.0.2 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-300.0.1 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-5.4.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-5.0.1 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-5.0.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
administrate-field-nested_has_many-1.3.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-4.0.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-3.0.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
viniBaxter-spa-nested_has_many-2.0.0 spec/dummy/app/dashboards/foo/student_dashboard.rb
administrate-field-nested_has_many-1.2.0 spec/dummy/app/dashboards/foo/student_dashboard.rb