Sha256: 6037b10441d8c2000964145fae8bfb9d8ac1925cdd8578624add77d68aaef9e4

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 Bytes

Contents

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

  before_action :load_pages, only: [:index, :manage, :nested_options, :indented_options, :optgroup]

  def index
  end

  def manage
  end

  def nested_options
  end

  def indented_options
  end

  def optgroup
  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 load_pages
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def sortable_model
    Admin::Page
  end

  def sortable_collection
    'admin_pages'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jquery_sortable_tree-3.1.2 spec/dummy_app/app/controllers/admin/pages_controller.rb
jquery_sortable_tree-3.1.1 spec/dummy_app/app/controllers/admin/pages_controller.rb
jquery_sortable_tree-3.1.0 spec/dummy_app/app/controllers/admin/pages_controller.rb