Class: EacRailsUtils::Menus::Action
- Inherits:
-
Node
- Object
- Node
- EacRailsUtils::Menus::Action
show all
- Defined in:
- lib/eac_rails_utils/menus/action.rb
Constant Summary
Constants inherited
from Node
Node::LABEL_TRANSLATE_KEY_PREFIX, Node::TRANSLATE_KEY_SEPARATOR
Instance Attribute Summary
Attributes inherited from Node
#custom_label
Instance Method Summary
collapse
Methods inherited from Node
#auto_label, #label, #label_translate_key, #parent_label_translate_key
Instance Method Details
#key ⇒ Symbol
14
15
16
|
# File 'lib/eac_rails_utils/menus/action.rb', line 14
def key
path.map(&:to_s).join('_').to_sym
end
|
20
21
22
|
# File 'lib/eac_rails_utils/menus/action.rb', line 20
def (view)
[view_path(view)]
end
|
#view_path(view) ⇒ String
26
27
28
29
30
|
# File 'lib/eac_rails_utils/menus/action.rb', line 26
def view_path(view)
path.each_with_index.inject(view) do |a, e|
a.send(e[1] == path.count - 1 ? "#{e[0]}_path" : e[0])
end
end
|