Class: NavigatorRails::Navigator

Inherits:
Object
  • Object
show all
Defined in:
lib/navigator_rails/navigator.rb

Class Method Summary collapse

Class Method Details

.render(path) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/navigator_rails/navigator.rb', line 4

def render path
  Constraint.context = binding.of_caller(1)
  Decorator.context  = binding.of_caller(1)

  path      = Item.normalize_path(path)
  resource  = Store.get(path)
  decorator = Decorator.for(:navigator)
  
  decorator.draw(resource).html_safe
end