Class: MegaBar::BlocksController
Instance Method Summary
collapse
#add_form_path_to_mega_displays, #administer_block, #administer_page, #collect_filters, #column_sorting, #conditions, #constant_from_controller, #create, #destroy, #form_path, #index, #is_displayable?, #might_filter?, #might_paginate?, #move, #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
#_params, #env
#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
#edit ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/mega_bar/blocks_controller.rb', line 12
def edit
@mega_instance = Block.find(params["id"])
@mega_displays[0][:displayable_fields].reject! do | df |
case df[:field].field
when 'index_model_display'
true if @mega_instance.model_displays.pluck(:action).include?'index'
when 'show_model_display'
true if @mega_instance.model_displays.pluck(:action).include?'show'
when 'edit_model_display'
true if @mega_instance.model_displays.pluck(:action).include?'edit'
when 'new_model_display'
true if @mega_instance.model_displays.pluck(:action).include?'new'
else
false
end
end
super
end
|
#get_options ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'app/controllers/mega_bar/blocks_controller.rb', line 33
def get_options
models = Model.all.pluck("name, id")
@options[:mega_bar_blocks] = {
model_id: models,
nest_level_1: models,
nest_level_2: models,
nest_level_3: models,
nest_level_4: models,
nest_level_5: models,
nest_level_6: models,
theme_ids: Theme.all.pluck("name, id"),
site_ids: Site.all.pluck("name, id"),
layout_section_id: LayoutSection.all.pluck("code_name, id"),
}
end
|
#new ⇒ Object
6
7
8
9
10
|
# File 'app/controllers/mega_bar/blocks_controller.rb', line 6
def new
@layout_id = params["layout_id"] if params["layout_id"]
@layout_section_id = params["layout_section_id"] if params["layout_section_id"]
super
end
|