Skip to main content
U.S. flag

An official website of the United States government

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Ruby guide

Help us make this section better by submitting an issue or joining us in the 18F only, #ruby channel!

A guide for writing and maintaining Ruby and Rails applications

Style guide

Follow the Ruby style guide and enforce it via static analysis tools such as Code Climate and Rubocop. You can copy the recommended Rubocop configuration in your Ruby project and make any changes based on your team's preferences.

Note that the Rubocop configuration linked above only includes settings that differ from the default configuration. We tend to agree with most of the default settings.

Whenever a Style Rubocop setting provides multiple options, at least one option must be chosen. A cop that supports different styles must never be disabled outright. The point is to pick one style and use it consistently.

Testing

Validating HTML output

We use HTMLProofer for testing rendered HTML automatically. Please see the test page for more details.

18F Engineering

An official website of the GSA’s Technology Transformation Services

Looking for U.S. government information and services?
Visit USA.gov