Sha256: 624b71c79cafca52011b44a3ccdc66b1eaead8a4e315418b8a2ba4930d1ff9d1

Contents?: true

Size: 577 Bytes

Versions: 2

Compression:

Stored size: 577 Bytes

Contents

require 'active_support/concern'

module SimplePages
  module Controllers
    module PageCluster
      extend ActiveSupport::Concern
      included do
        helper_method :pages_cluster_for
      end

      module ClassMethods
      end

      protected

      def pages_cluster_for(name, location)
        SimplePages::Page.with_cluster(name).layout_at(location).published
      end

      def load_page_cluster_options
        @cluster_options = ::Role.enabled.map do |role|
          [t(role.name, scope: 'roles.names'), role.name]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple-pages-rails-0.6.0 lib/simple_pages/controllers/page_cluster.rb
simple-pages-rails-0.5.0 lib/simple_pages/controllers/page_cluster.rb