Sha256: d91e46a676dd3e7489b8193e85c76dd26950bbce8f6db8a9bb87b0599d18423f

Contents?: true

Size: 858 Bytes

Versions: 24

Compression:

Stored size: 858 Bytes

Contents

module Cmor
  module Cms
    # Usage:
    #
    #     # app/controllers/application_controller.rb
    #     class ApplicationController < ActionController::Base
    #       view_helper Cmor::Cms::ApplicationViewHelper, as: :cms_helper
    #     end
    #
    class ApplicationViewHelper < Rao::ViewHelper::Base
      def title
        c.content_for(:title)
      end

      def meta_description
        "<meta name=\"description\" content=\"#{c.content_for(:meta_description)}\">"
      end

      def link_to_top
        c.render partial: '/cmor/cms/link_to_top'
      end

      def is_page?
        params[:action] == 'respond' && params.has_key?(:page)
      end

      def current_page?(page)
        cms_page? && params[:page].to_s == page.to_s
      end

      def current_page
        cms_page? ? params[:page].to_s : nil
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
cmor_cms-0.0.26.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.25.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.24.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.22.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.21.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.20.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.19.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.18.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.17.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.15.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.14.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.13.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.12.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.11.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.10.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.9.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.8.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.7.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.6.pre app/view_helpers/cmor/cms/application_view_helper.rb
cmor_cms-0.0.5.pre app/view_helpers/cmor/cms/application_view_helper.rb