Sha256: 3ea2b1a70fcb451c8738faf88d3b86285f6ff987002b2c5fe7ff0648fbd56889

Contents?: true

Size: 525 Bytes

Versions: 5

Compression:

Stored size: 525 Bytes

Contents

module Adminos::Controllers::Helpers
  extend ActiveSupport::Concern

  included do
    helper_method :settings, :top_navigation, :current_page, :title_default
  end

  def settings
    @settings ||= Settings.get
  end

  def top_navigation
    @top_navigation ||= Page.navigation_top
  end

  def current_page
    @current_page ||= Page.published.find params[:page_id] if params[:page_id]
  end

  def title_default
    title ||= settings.index_meta_title
    title.present? ? title : current_page.name rescue nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adminos-1.0.0.pre.rc.5 lib/adminos/controllers/helpers.rb
adminos-1.0.0.pre.rc.4 lib/adminos/controllers/helpers.rb
adminos-1.0.0.pre.rc.3 lib/adminos/controllers/helpers.rb
adminos-1.0.0.pre.rc.2 lib/adminos/controllers/helpers.rb
adminos-1.0.0.pre.rc.1 lib/adminos/controllers/helpers.rb