Module: Engine2::MetaViewSupport
Class Method Summary
collapse
Instance Method Summary
collapse
#action_defined, #get_type_info, #hide_pk, #show_pk, #unsupported_association
#config, #decorate, #field_filter, #hide_fields, #info, #info!, #loc!, #reload_routes!, #render, #show_fields
#field_tabs, #lazy_tab, #select_tabs
#modal_action, #panel, #panel_class, #panel_footer, #panel_panel_template, #panel_template, #panel_title, #post_run
#menu, #menu?
Class Method Details
.included(meta) ⇒ Object
904
905
906
|
# File 'lib/engine2/meta.rb', line 904
def self.included meta
meta.meta_type :view
end
|
Instance Method Details
#invoke(handler) ⇒ Object
920
921
922
923
924
925
926
927
928
929
|
# File 'lib/engine2/meta.rb', line 920
def invoke handler
handler.permit id = handler.params[:id]
record = find_record(handler, id)
if record
static.record(handler, record)
{record: record}
else
handler.halt_not_found LOCS[:no_entry]
end
end
|
#post_process ⇒ Object
931
932
933
934
935
936
937
938
939
940
941
942
943
944
|
# File 'lib/engine2/meta.rb', line 931
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
|
908
909
910
911
912
913
914
915
|
# File 'lib/engine2/meta.rb', line 908
def pre_run
super
panel_template 'scaffold/view'
panel_title LOCS[:view_title]
(:panel_menu).option :cancel, icon: "remove"
action.parent.*.(:item_menu).option action.name, icon: "file", button_loc: false
end
|
#record(handler, record) ⇒ Object
917
918
|
# File 'lib/engine2/meta.rb', line 917
def record handler, record
end
|