Module: Bh::LinkToHelper

Includes:
BaseHelper
Defined in:
lib/bh/helpers/link_to_helper.rb

Instance Method Summary collapse

Instance Method Details

Overrides ActionView +link_to+ to be able to add the 'alert-link' class to the link in case the link is inside of an alert. Overrides ActionView +link_to+ to be able to surround the link in a '

  • ' item in case the link is inside of a nav. Overrides ActionView +link_to+ to be able to add the 'navbar-brand' class to the link in case the link is inside of an alert.

  • 
    
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    # File 'lib/bh/helpers/link_to_helper.rb', line 14
    
    def link_to(*args, &block)
      if @alert_link
        super *add_link_class!('alert-link', *args, &block), &block
      elsif @navbar_vertical
        super *add_link_class!('navbar-brand', *args, &block), &block
      elsif @dropdown_link
         :li, role: :presentation do
          super *add_menu_item_attributes!(*args, &block), &block
        end
      elsif @nav_link
         :li, super(*args, &block), nav_item_options(*args, &block)
      else
        super *args, &block
      end
    end