Sha256: d146e04402877606f2b66be929e050516c58c4979103352a5675e094ff2f23b9

Contents?: true

Size: 584 Bytes

Versions: 16

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

16 entries across 16 versions & 1 rubygems

Version Path
landable-1.13.1 app/helpers/landable/pages_helper.rb
landable-1.12.3 app/helpers/landable/pages_helper.rb
landable-1.12.2 app/helpers/landable/pages_helper.rb
landable-1.12.1 app/helpers/landable/pages_helper.rb
landable-1.11.1 app/helpers/landable/pages_helper.rb
landable-1.11.0 app/helpers/landable/pages_helper.rb
landable-1.10.0.rc2 app/helpers/landable/pages_helper.rb
landable-1.10.0.rc1 app/helpers/landable/pages_helper.rb
landable-1.9.2 app/helpers/landable/pages_helper.rb
landable-1.9.1 app/helpers/landable/pages_helper.rb
landable-1.9.0 app/helpers/landable/pages_helper.rb
landable-1.9.0.rc2 app/helpers/landable/pages_helper.rb
landable-1.9.0.rc1 app/helpers/landable/pages_helper.rb
landable-1.8.0 app/helpers/landable/pages_helper.rb
landable-1.7.1.rc1 app/helpers/landable/pages_helper.rb
landable-1.7.0 app/helpers/landable/pages_helper.rb