Sha256: ca30a083513eaa5ee118aefca0662da34c2c34177cab8a836f79e7cab3401ebf

Contents?: true

Size: 583 Bytes

Versions: 11

Compression:

Stored size: 583 Bytes

Contents

module Puffer
  class TreeBase < Puffer::Base
    unloadable

    view_paths_fallbacks_prepend :puffer_tree
    helper :puffer_tree

    define_fields :tree

    def self.tree_fields
      _tree_fields.presence || index_fields
    end

    def index
      return super if params[:search]
      @records = resource.collection_scope.includes(resource.includes).arrange
      render 'tree'
    end

    member do
      get :inherit, :label => 'new page'
    end

    def inherit
      @parent = resource.member
      @record = @parent.children.new
      render 'new'
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
puffer_pages-0.0.13 lib/puffer/tree_base.rb
puffer_pages-0.0.12 lib/puffer/tree_base.rb
puffer_pages-0.0.11 lib/puffer/tree_base.rb
puffer_pages-0.0.10 lib/puffer/tree_base.rb
puffer_pages-0.0.9 lib/puffer/tree_base.rb
puffer_pages-0.0.8 lib/puffer/tree_base.rb
puffer_pages-0.0.7 lib/puffer/tree_base.rb
puffer_pages-0.0.6 lib/puffer/tree_base.rb
puffer_pages-0.0.5 lib/puffer/tree_base.rb
puffer_pages-0.0.4 lib/puffer/tree_base.rb
puffer_pages-0.0.3 lib/puffer/tree_base.rb