Sha256: bcb41f7e880e28c428f0312866bf67daac7df9f779697876f805b2b722af22b1

Contents?: true

Size: 584 Bytes

Versions: 2

Compression:

Stored size: 584 Bytes

Contents

module Landable
  module PagesHelper
    def landable(page = current_page)
      return Landable::NullPageDecorator.new if page.nil?
      @landable ||= Landable::PageDecorator.new(page)
    end

    def current_page
      if params[:controller] == 'landable/public/preview/page_revisions'
        current_page = PageRevision.find(params[:id])
      elsif params[:controller] == 'landable/public/preview/pages'
        current_page = Page.find(params[:id])
      else
        current_page = Page.by_path(request.path)
      end

      @current_page ||= current_page
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 app/helpers/landable/pages_helper.rb
landable-1.13.2 app/helpers/landable/pages_helper.rb