Sha256: f45c2cac7bd5274d63bdb7e1dc1a81195a982143e5a6a03fc087fec3fa8fd357

Contents?: true

Size: 534 Bytes

Versions: 11

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

module Navigator
  # Navigation helper methods for the view layer.
  module NavigationHelper
    def navigation tag = "ul", attributes: {}, activator: navigation_activator, &block
      Navigator::Menu.new(self, tag:, attributes:, activator:, &block)
                     .render
                     .then { |html| raw html }
    end

    module_function

    def current_path = request.env["PATH_INFO"]

    def navigation_activator = Navigator::TagActivator.new(search_value: current_path)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
navigator-8.0.1 app/helpers/navigator/navigation_helper.rb
navigator-8.0.0 app/helpers/navigator/navigation_helper.rb
navigator-7.5.0 app/helpers/navigator/navigation_helper.rb
navigator-7.4.0 app/helpers/navigator/navigation_helper.rb
navigator-7.3.0 app/helpers/navigator/navigation_helper.rb
navigator-7.2.3 app/helpers/navigator/navigation_helper.rb
navigator-7.2.2 app/helpers/navigator/navigation_helper.rb
navigator-7.2.1 app/helpers/navigator/navigation_helper.rb
navigator-7.2.0 app/helpers/navigator/navigation_helper.rb
navigator-7.1.0 app/helpers/navigator/navigation_helper.rb
navigator-7.0.0 app/helpers/navigator/navigation_helper.rb