Method: Innate::Node#alias_view
- Defined in:
- lib/innate/node.rb
#alias_view(to, from, node = nil) ⇒ Object
Aliasing one view from another. The aliases are inherited, and the optional third node parameter indicates the Node to take the view from.
The argument order is identical with alias and alias_method, which quite honestly confuses me, but at least we stay consistent.
Note that the parameters have been simplified in comparision with Ramaze::Controller::template where the second parameter may be a Controller or the name of the template. We take that now as an optional third parameter.
615 616 617 618 |
# File 'lib/innate/node.rb', line 615 def alias_view(to, from, node = nil) trait[:alias_view] || trait(:alias_view => {}) trait[:alias_view][to.to_s] = node ? [from.to_s, node] : from.to_s end |