Sha256: e6fead81421bdf6d5c205c4676b267a5c3507ee9a3a94d0a1f6fb6e1f5c32c08

Contents?: true

Size: 377 Bytes

Versions: 31

Compression:

Stored size: 377 Bytes

Contents

module Smithy
  module PagesHelper
    def tree_for_select
      tree_for_select = []
      Smithy::Page.each_with_level(Smithy::Page.root.self_and_descendants) do |page, level|
        prepend = level == 0 ? '' : "#{'-' * level} "
        tree_for_select << [ "#{prepend}#{page.title}", page.id]
      end if Smithy::Page.root.present?
      tree_for_select
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
smithycms-0.8.1 app/helpers/smithy/pages_helper.rb
smithycms-0.7.3 app/helpers/smithy/pages_helper.rb
smithycms-0.7.2 app/helpers/smithy/pages_helper.rb
smithycms-0.7.1 app/helpers/smithy/pages_helper.rb
smithycms-0.7.0 app/helpers/smithy/pages_helper.rb
smithycms-0.6.10 app/helpers/smithy/pages_helper.rb
smithycms-0.5.99.3 app/helpers/smithy/pages_helper.rb
smithycms-0.6.9 app/helpers/smithy/pages_helper.rb
smithycms-0.6.7 app/helpers/smithy/pages_helper.rb
smithycms-0.6.6 app/helpers/smithy/pages_helper.rb
smithycms-0.6.5 app/helpers/smithy/pages_helper.rb
smithycms-0.6.4 app/helpers/smithy/pages_helper.rb
smithycms-0.6.3 app/helpers/smithy/pages_helper.rb
smithycms-0.5.99.2 app/helpers/smithy/pages_helper.rb
smithycms-0.5.99.1 app/helpers/smithy/pages_helper.rb
smithycms-0.5.99 app/helpers/smithy/pages_helper.rb
smithycms-0.6.2 app/helpers/smithy/pages_helper.rb
smithycms-0.6.1 app/helpers/smithy/pages_helper.rb
smithycms-0.5.2 app/helpers/smithy/pages_helper.rb
smithycms-0.6.0 app/helpers/smithy/pages_helper.rb