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
11
12
13
|
# File 'lib/eac_rails_utils/menus/action.rb', line 11
def key
path.map(&:to_s).join('_').to_sym
end
|
17
18
19
|
# File 'lib/eac_rails_utils/menus/action.rb', line 17
def (view)
[view_path(view)]
end
|
#view_path(view) ⇒ String
23
24
25
26
27
|
# File 'lib/eac_rails_utils/menus/action.rb', line 23
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
|