Class: NavLinkHelper::LinkGenerator

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::UrlHelper
Defined in:
app/helpers/nav_link_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, title, path, html_options = {}, options = {}) ⇒ LinkGenerator

Returns a new instance of LinkGenerator.



15
16
17
18
19
20
21
# File 'app/helpers/nav_link_helper.rb', line 15

def initialize(request, title, path, html_options = {}, options = {})
  @request      = request
  @title        = title
  @path         = path
  @html_options = html_options
  @options      = options
end

Instance Method Details

#to_htmlObject



23
24
25
26
27
28
29
30
31
# File 'app/helpers/nav_link_helper.rb', line 23

def to_html
  html = link

  if @options[:wrapper]
    html = (@options[:wrapper], html, :class => wrapper_classes)
  end

  html.html_safe
end