Sha256: 1fee01a603325ad4ec919c4ff02df7121d83005546b14de509c90e0b54a2e9f0

Contents?: true

Size: 733 Bytes

Versions: 2

Compression:

Stored size: 733 Bytes

Contents

module MegaBar
  class ModelsController < ApplicationController
    include MegaBarConcern

    def index
      @mega_instance ||= Model.where.not(modyule: 'MegaBar').order(column_sorting)
      super.index
    end
    def all
      @mega_instance = Model.all.order(column_sorting) # .page(@page_number).per(5)
      index
    end


    def get_options

      @options[:mega_bar_models] =  {
        position_parent: MegaBar::Model.all.pluck(:name, :modyule, :classname).map{|a|  [a[1] + ' - ' + a[0], a[1] +'::' +  a[2]] }.unshift(['Position with No Parent', 'pnp']),
        default_sort_field: Field.by_model(params[:id]).pluck("field, field"),      
        make_page: Template.all.pluck("name, id"),  
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mega_bar-0.5.2 app/controllers/mega_bar/models_controller.rb
mega_bar-0.5.1 app/controllers/mega_bar/models_controller.rb