Module: Engine2::MetaViewSupport

Includes:
MetaAPISupport, MetaMenuSupport, MetaModelSupport, MetaPanelSupport, MetaTabSupport
Included in:
ViewMeta
Defined in:
lib/engine2/meta.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MetaModelSupport

#action_defined, #get_type_info, #hide_pk, #show_pk, #unsupported_association

Methods included from MetaAPISupport

#config, #decorate, #field_filter, #hide_fields, #info, #info!, #loc!, #reload_routes!, #render, #show_fields

Methods included from MetaTabSupport

#field_tabs, #lazy_tab, #select_tabs

Methods included from MetaPanelSupport

#footer, #modal_action, #panel, #panel_class, #panel_panel_template, #panel_template, #panel_title, #post_run

Methods included from MetaMenuSupport

#menu

Class Method Details

.included(meta) ⇒ Object



753
754
755
# File 'lib/engine2/meta.rb', line 753

def self.included meta
    meta.meta_type :view
end

Instance Method Details

#post_processObject



766
767
768
769
770
771
772
773
774
775
776
777
778
779
# File 'lib/engine2/meta.rb', line 766

def post_process
    if fields = @meta[:fields]
        fields = fields - static.get[:fields] if dynamic?

        decorate(fields)
        fields.each do |name|
            type_info = get_type_info(name)
            proc = ListRendererPostProcessors[type_info[:type]]
            proc.(self, name, type_info) if proc
        end
    end

    super
end

#pre_runObject



757
758
759
760
761
762
763
764
# File 'lib/engine2/meta.rb', line 757

def pre_run
    super
    panel_template 'scaffold/view'
    panel_title LOCS[:view_title]

    menu(:panel_menu).option :cancel, icon: "remove"
    action.parent.*.menu(:item_menu).option action.name, icon: "file", button_loc: false
end