Module: NavLinks::ViewHelpers
- Defined in:
- lib/nav_links/view_helpers.rb
Defined Under Namespace
Classes: NavLinksOptions
Instance Method Summary collapse
Instance Method Details
#nav_link_to(*args, &block) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/nav_links/view_helpers.rb', line 3 def nav_link_to(*args, &block) title = block_given? ? capture(&block) : args.shift path = args[0] = args[1] || {} = args[2] || {} LinkGenerator.new(request, title, path, , ).to_html end |
#nav_links(options = {}) {|option_wrapper| ... } ⇒ Object
12 13 14 15 16 |
# File 'lib/nav_links/view_helpers.rb', line 12 def nav_links( = {}) raise ArgumentError, "Missing block" unless block_given? option_wrapper = NavLinksOptions.new(self, ) yield option_wrapper end |