Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu_for(controller_identifier, tab_item=nil)
- if controller_identifier =~ /detailed_alarms/
- return "configure_detailed_alarms_checkbox_menu_item"
- end
- tab_name = tab_item ? "_#{tab_item}_" : ''
- choices = (self.methods - Object.methods).select {|m|
- m =~ /action_performed/
- }.select { |m| m =~ /#{controller_identifier}#{tab_name}/ }
- raise "menu handler trouble for '#{controller_identifier}:\n #{choices.inspect}'" if choices.empty? || choices.size > 1
- choices.first.sub('_action_performed', '')
- end
Add Comment
Please, Sign In to add comment