Sha256: c334c0def4d36ea4423d3c511c11c7705b7fc5e174c169830a82136d788fd532

Contents?: true

Size: 580 Bytes

Versions: 1

Compression:

Stored size: 580 Bytes

Contents

module Spotlight
  class HomePage < Spotlight::Page
    extend FriendlyId
    friendly_id :title, use: [:slugged,:scoped,:finders], scope: :exhibit

    before_save :publish
    before_create :default_content

    def should_display_title?
      display_title
    end

    def display_sidebar?
      exhibit.searchable? && self.display_sidebar
    end

    private
    def self.default_title_text
      "Exhibit Home"
    end

    def publish
      self.published = true
    end

    def default_content
      self.title = Spotlight::HomePage.default_title_text
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.4.1 app/models/spotlight/home_page.rb