Sha256: 1cdfe143313a64812c9d489456ec97205ffa85054a3c323c8d6ceb9ef4cb989c

Contents?: true

Size: 438 Bytes

Versions: 1

Compression:

Stored size: 438 Bytes

Contents

# frozen_string_literal: true

class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
  class << self
    def collections
      [:all]
    end
  end

  delegate :title, to: :object

  def lead
    object.body.first 200
  end

  def link
    Tramway::Page::Engine.routes.url_helpers.page_path slug: object.slug
  end

  def public_path
    Tramway::Page::Engine.routes.url_helpers.page_path slug: object.slug
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tramway-page-1.4 app/decorators/tramway/page/page_decorator.rb