Sha256: 124c1b2c766fda7a65b580089a89f9c786108172a063d954501933fa8bac32c7

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 Bytes

Contents

class Admin::PagesController < ApplicationController
  include JquerySortableTreeController::Rebuild

  def index
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def manage
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def nested_options
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def indented_options
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def node_manage
    @root  = Admin::Page.root
    @pages = @root.self_and_descendants.nested_set.select('id, title, content, parent_id').limit(15) if @root
    render template: 'admin/pages/manage'
  end

  protected

  def sortable_model
    Admin::Page
  end

  def sortable_collection
    'admin_pages'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jquery_sortable_tree-3.0.0 spec/dummy_app/app/controllers/admin/pages_controller.rb