The project is in a healthy, maintained state
Adds the GOVUK frontend to a Rails application that uses the Asset Pipeline.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Defra Ruby Template

Build Status security Gem Version Licence

About

Adds a GOV.UK-ready layout template and the govuk_frontend assets to a Rails application.

Installation

Add this line to the application's Gemfile:

gem 'defra-ruby-template'

And then execute:

$ bundle

Usage

The Rails application will need to have SCSS enabled (e.g. sass-rails).

This gem includes the defra_ruby_template layout, and can be included in a Rails project by adding the following to the default layout (e.g. application.html.erb)


<% content_for :page_title do %>
    Page title or defaults to the i18n `global_proposition_header`
<% end %>

<% content_for :head do %>
  Stylesheets, Analytics, etc.
<% end %>

<% content_for :header_content do %>
 Application name and top-level links
<% end %>

<% content_for :phase_banner do %>
  Phase banner, e.g Alpha, Beta, etc
<% end %>

<% content_for :back_link do %>
    Link to go back
<% end %>

<% content_for :footer do %>
  Application specific footer links
<% end %>

<%= render template: "layouts/defra_ruby_template" %>

Updating the govuk-frontend

To update to the latest govuk-frontend files:

$ npm install govuk-frontend --save
$ rake

Then update the DefraRubyTemplate::Version so that it matches the govuk-frontend version.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DEFRA/defra-ruby-template.