Sha256: 860e864f685a2a29954b5be9c1c72a0c06e2be6dc14a49df0e05221dacb7c82a

Contents?: true

Size: 603 Bytes

Versions: 4

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

module Navigator
  # Navigation helper methods for the view layer.
  module NavigationHelper
    # rubocop:disable Metrics/ParameterLists
    # rubocop:disable Metrics/LineLength
    def navigation tag = "ul", attributes: {}, activator: navigation_activator, &block
      raw Navigator::Menu.new(self, tag: tag, attributes: attributes, activator: activator, &block).render
    end

    module_function

    def current_path
      request.env["PATH_INFO"]
    end

    def navigation_activator
      Navigator::TagActivator.new search_value: current_path
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
navigator-2.4.1 app/helpers/navigator/navigation_helper.rb
navigator-2.4.0 app/helpers/navigator/navigation_helper.rb
navigator-2.3.0 app/helpers/navigator/navigation_helper.rb
navigator-2.2.0 app/helpers/navigator/navigation_helper.rb