Class: NavLinkHelper::LinkGenerator
- Inherits:
-
Object
- Object
- NavLinkHelper::LinkGenerator
- Includes:
- ActionView::Helpers::UrlHelper
- Defined in:
- app/helpers/nav_link_helper.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(request, title, url_options, controller, html_options = {}, options = {}) ⇒ LinkGenerator
constructor
A new instance of LinkGenerator.
- #to_html ⇒ Object
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, , controller, = {}, = {}) @request = request @title = title @url_options = @html_options = @options = @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (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_html ⇒ Object
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 = content_tag(@options[:wrapper], html, :class => wrapper_classes) end html.html_safe end |