Module: Engine2::ActionMenuSupport
- Included in:
- ActionFormSupport, ActionListSupport, ActionViewSupport, ConfirmAction, InfraAction, InspectModalAction, LogoutFormAction, MenuAction
- Defined in:
- lib/engine2/action.rb
Instance Method Summary collapse
Instance Method Details
#menu(menu_name, &blk) ⇒ Object
269 270 271 272 273 274 |
# File 'lib/engine2/action.rb', line 269 def , &blk @menus ||= {} @menus[] ||= ActionMenuBuilder.new(:root) @menus[].instance_eval(&blk) if blk @menus[] end |
#menu?(menu_name) ⇒ Boolean
276 277 278 |
# File 'lib/engine2/action.rb', line 276 def @menus && @menus[] end |
#post_process ⇒ Object
280 281 282 283 284 285 286 287 288 |
# File 'lib/engine2/action.rb', line 280 def post_process super if @menus && !@menus.empty? @meta[:menus] = {} @menus.each_pair do |name, | @meta[:menus][name] = {entries: .to_a, properties: .properties} end end end |