Module: Goose::Helper

Defined in:
lib/goose/helper.rb

Instance Method Summary collapse

Instance Method Details

#gooseObject



5
6
7
# File 'lib/goose/helper.rb', line 5

def goose
  @goose ||= State.new(self)
end


22
23
24
# File 'lib/goose/helper.rb', line 22

def nav(name = nil)
  nav_at(nil, :in => name)
end


17
18
19
20
# File 'lib/goose/helper.rb', line 17

def nav_at(place, options = {})
  nav = options[:in] || :main
  goose.render(nav, place)
end


9
10
11
12
13
14
15
# File 'lib/goose/helper.rb', line 9

def nav_to(place, url, options = {}, &block)
  if goose.at?(place)
    options.update(Goose.config.active_options)
  end
  content = link_to(place, url) if url 
  (Goose.config.wrapper_tag, content, options, &block)
end