Class: NavLinks::ViewHelpers::NavLinksOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/nav_links/view_helpers.rb

Instance Method Summary collapse

Constructor Details

#initialize(base, options = {}) ⇒ NavLinksOptions

Returns a new instance of NavLinksOptions.



19
20
21
22
# File 'lib/nav_links/view_helpers.rb', line 19

def initialize(base, options = {})
  @base = base
  @options = options
end

Instance Method Details



24
25
26
27
28
29
# File 'lib/nav_links/view_helpers.rb', line 24

def link_to(*args, &block)
  index = block_given? ? 2 : 3
  args[index] = @options.merge(args[index] || {})

  @base.nav_link_to(*args, &block)
end