module Engine2::ActionViewSupport
Public Class Methods
included(action)
click to toggle source
# File lib/engine2/action.rb, line 1132 def self.included action action.action_type :view end
Public Instance Methods
field_tabs(hash)
click to toggle source
Calls superclass method
# File lib/engine2/action.rb, line 1146 def field_tabs hash super panel_template 'scaffold/view_tabs' end
invoke(handler)
click to toggle source
# File lib/engine2/action.rb, line 1154 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()
click to toggle source
Calls superclass method
# File lib/engine2/action.rb, line 1165 def post_process if fields = @meta[:field_list] model = assets[:model] fields = fields - static.meta[:field_list] if dynamic? decorate(fields) fields.each do |name| type_info = model.find_type_info(name) proc = ListRendererPostProcessors[type_info[:type]] proc.(self, name, type_info) if proc end end super end
pre_run()
click to toggle source
Calls superclass method
# File lib/engine2/action.rb, line 1136 def pre_run super panel_template 'scaffold/view' panel_title "#{LOCS[:view_title]} - #{LOCS[assets[:model].table_name]}" panel[:backdrop] = true menu(:panel_menu).option :close, icon: "remove" node.parent.*.menu(:item_menu).option node.name, icon: "file", button_loc: false end
record(handler, record)
click to toggle source
# File lib/engine2/action.rb, line 1151 def record handler, record end