module Engine2::ActionModifySupport
Public Class Methods
included(action)
click to toggle source
# File lib/engine2/action.rb, line 1092 def self.included action action.action_type :modify end
Public Instance Methods
invoke(handler)
click to toggle source
# File lib/engine2/action.rb, line 1109 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
modify_record(handler, record)
click to toggle source
# File lib/engine2/action.rb, line 1106 def modify_record handler, record end
post_run()
click to toggle source
Calls superclass method
Engine2::ActionFormSupport#post_run
# File lib/engine2/action.rb, line 1121 def post_run super assets[:model].primary_keys.each do |key| # pre_run ? fields! key, disabled: true end end
pre_run()
click to toggle source
Calls superclass method
Engine2::ActionFormSupport#pre_run
# File lib/engine2/action.rb, line 1096 def pre_run super panel_title "#{LOCS[:modify_title]} - #{LOCS[assets[:model].table_name]}" node.parent.*.menu(:item_menu).option node.name, icon: "pencil", button_loc: false end
record(handler, record)
click to toggle source
# File lib/engine2/action.rb, line 1102 def record handler, record modify_record(handler, record) end