New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

govuk_navigation_helpers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

govuk_navigation_helpers

  • 9.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GOV.UK Navigation Helpers

This is a gem to share code between GOV.UK frontends.

** It should not be used anymore ***

This gem was a temporary solution to the problem of sharing code used to generate the input to components. Since the components can now be built into the govuk_publishing_components gem, it is no longer necessary.

Nomenclature

  • content item: An object returned by the content store

Technical documentation

These helpers format data from the content store for use with GOV.UK Components.

Installation

Add this line to your application's Gemfile:

gem 'govuk_navigation_helpers', '~> VERSION'

And then execute:

$ bundle

Configuration

This gem allows the configuration of:

  • an error handler class (e.g. Airbrake), that implements a notify method which takes an exception object (by default, it prints the exception to stdout when not configured);
  • a statsd client - when not configured, it does not do anything. This client should implement increment(metric) and time(metric, &block).

Usage

Get the JSON representation of a page and initialise the helper:

def some_controller_method
  content_item = Services.content_store.content_item("/register-to-vote")
  @navigation = GovukNavigationHelpers::NavigationHelper.new(content_item)
end

Render the component:

<%= render partial: 'govuk_component/breadcrumbs', locals: @navigation.breadcrumbs %>
<%= render partial: 'govuk_component/related_items', locals: @navigation.related_items %>

Running the test suite

bundle exec rake

Documentation

See RubyDoc for some limited documentation.

To run a Yard server locally to preview documentation, run:

$ bundle exec yard server --reload

Licence

MIT License

FAQs

Package last updated on 16 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc