Class: MegaBar::PagesController

Inherits:
ApplicationController show all
Includes:
AuthorizationConcern, MegaBarConcern
Defined in:
app/controllers/mega_bar/pages_controller.rb

Instance Method Summary collapse

Methods included from MegaBarConcern

#add_form_path_to_mega_displays, #administer_block, #administer_page, #collect_filters, #column_sorting, #conditions, #constant_from_controller, #create, #destroy, #form_path, #is_displayable?, #might_filter?, #might_paginate?, #move, #new, #num_per_page, #process_filters, #redo_setup, #set_vars_for_all, #set_vars_for_displays, #show, #sort_column, #sort_direction, #test_create, #unpack_nested_classes, #update

Methods inherited from ApplicationController

#_params, #env

Methods included from AuthorizationHelper

#can_create?, #can_destroy?, #can_edit?, #can_index?, #can_perform_action?, #can_show?, #can_update?, #has_mega_role?, #link_if_can, #link_if_can_create, #link_if_can_destroy, #link_if_can_edit, #link_if_can_index, #link_if_can_show, #link_if_can_update, #link_if_can_with_wrapper

Instance Method Details

#allObject



12
13
14
15
16
# File 'app/controllers/mega_bar/pages_controller.rb', line 12

def all
  @mega_instance = Page.where(mega_page: 'mega').order(column_sorting)
   # .page(@page_number).per(10)
  index
end

#editObject



18
19
20
21
# File 'app/controllers/mega_bar/pages_controller.rb', line 18

def edit
  session[:return_to] = request.referer
  super
end

#get_optionsObject



23
24
25
26
27
28
# File 'app/controllers/mega_bar/pages_controller.rb', line 23

def get_options
  @options[:mega_bar_pages] =  {
    template_id: Template.all.pluck("name, id"),
    # administrator: PermissionLevel.all.pluck("level_name, level"),
  }
end

#indexObject



7
8
9
10
# File 'app/controllers/mega_bar/pages_controller.rb', line 7

def index  
  @mega_instance ||= Page.where("mega_page = 'f' or mega_page is null or mega_page = '' or mega_page = 'regular' or path = '/'").order(column_sorting)
  super
end