Sha256: 38b7c05bfd3b1f309b7d2adf258bf95772d970c4aeb3f9372e65875cac7a6988

Contents?: true

Size: 436 Bytes

Versions: 4

Compression:

Stored size: 436 Bytes

Contents

module Navigator
  module NavigationHelper
    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-1.3.0 app/helpers/navigator/navigation_helper.rb
navigator-1.2.0 app/helpers/navigator/navigation_helper.rb
navigator-1.1.0 app/helpers/navigator/navigation_helper.rb
navigator-1.0.0 app/helpers/navigator/navigation_helper.rb