Class: NavLinkHelper::LinkGenerator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of LinkGenerator.



18
19
20
21
22
23
24
25
# File 'app/helpers/nav_link_helper.rb', line 18

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

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



16
17
18
# File 'app/helpers/nav_link_helper.rb', line 16

def controller
  @controller
end

Instance Method Details

#to_htmlObject



27
28
29
30
31
32
33
34
35
# File 'app/helpers/nav_link_helper.rb', line 27

def to_html
  html = link

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

  html.html_safe
end